fix: move setExtendCT inside function

This commit is contained in:
Marc-Roig 2023-04-19 10:04:30 +02:00
parent a38fcb7af4
commit 0260b7d654

View File

@ -33,6 +33,8 @@ async function initDefaultWorkflow({ workflowsService, stagesService, strapi })
}
}
function extendReviewWorkflowContentTypes({ strapi }) {
const extendContentType = (contentTypeUID) => {
const setStageAttribute = set(`attributes.${ENTITY_STAGE_ATTRIBUTE}`, {
writable: true,
private: false,
@ -43,9 +45,6 @@ const setStageAttribute = set(`attributes.${ENTITY_STAGE_ATTRIBUTE}`, {
relation: 'oneToOne',
target: 'admin::workflow-stage',
});
function extendReviewWorkflowContentTypes({ strapi }) {
const extendContentType = (contentTypeUID) => {
strapi.container.get('content-types').extend(contentTypeUID, setStageAttribute);
};
pipe([