fix: depends on should be an array

This commit is contained in:
Marc-Roig 2023-04-27 18:11:17 +02:00
parent 2b77c4ac88
commit 9dae8499d5
No known key found for this signature in database
GPG Key ID: FB4E2C43A0BEE249

View File

@ -94,7 +94,7 @@ function persistStagesJoinTables({ strapi }) {
// Persist the stage join table
const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID);
const joinTableName = attributes[ENTITY_STAGE_ATTRIBUTE].joinTable.name;
return { name: joinTableName, dependsOn: { name: tableName } };
return { name: joinTableName, dependsOn: [{ name: tableName }] };
};
const joinTablesToPersist = pipe([
@ -119,7 +119,7 @@ module.exports = ({ strapi }) => {
async register() {
extendReviewWorkflowContentTypes({ strapi });
strapi.hook('strapi::content-types.afterSync').register(enableReviewWorkflow({ strapi }));
strapi.hook('strapi::content-types.afterSync').register(persistStagesJoinTables({ strapi }));
strapi.hook('strapi::content-types.beforeSync').register(persistStagesJoinTables({ strapi }));
},
};
};