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,19 +33,18 @@ async function initDefaultWorkflow({ workflowsService, stagesService, strapi })
}
}
const setStageAttribute = set(`attributes.${ENTITY_STAGE_ATTRIBUTE}`, {
writable: true,
private: false,
configurable: false,
visible: false,
useJoinTable: true, // We want a join table to persist data when downgrading to CE
type: 'relation',
relation: 'oneToOne',
target: 'admin::workflow-stage',
});
function extendReviewWorkflowContentTypes({ strapi }) {
const extendContentType = (contentTypeUID) => {
const setStageAttribute = set(`attributes.${ENTITY_STAGE_ATTRIBUTE}`, {
writable: true,
private: false,
configurable: false,
visible: false,
useJoinTable: true, // We want a join table to persist data when downgrading to CE
type: 'relation',
relation: 'oneToOne',
target: 'admin::workflow-stage',
});
strapi.container.get('content-types').extend(contentTypeUID, setStageAttribute);
};
pipe([