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,7 +33,9 @@ async function initDefaultWorkflow({ workflowsService, stagesService, strapi })
} }
} }
const setStageAttribute = set(`attributes.${ENTITY_STAGE_ATTRIBUTE}`, { function extendReviewWorkflowContentTypes({ strapi }) {
const extendContentType = (contentTypeUID) => {
const setStageAttribute = set(`attributes.${ENTITY_STAGE_ATTRIBUTE}`, {
writable: true, writable: true,
private: false, private: false,
configurable: false, configurable: false,
@ -42,10 +44,7 @@ const setStageAttribute = set(`attributes.${ENTITY_STAGE_ATTRIBUTE}`, {
type: 'relation', type: 'relation',
relation: 'oneToOne', relation: 'oneToOne',
target: 'admin::workflow-stage', target: 'admin::workflow-stage',
}); });
function extendReviewWorkflowContentTypes({ strapi }) {
const extendContentType = (contentTypeUID) => {
strapi.container.get('content-types').extend(contentTypeUID, setStageAttribute); strapi.container.get('content-types').extend(contentTypeUID, setStageAttribute);
}; };
pipe([ pipe([