mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
fix: move setExtendCT inside function
This commit is contained in:
parent
a38fcb7af4
commit
0260b7d654
@ -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 }) {
|
function extendReviewWorkflowContentTypes({ strapi }) {
|
||||||
const extendContentType = (contentTypeUID) => {
|
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);
|
strapi.container.get('content-types').extend(contentTypeUID, setStageAttribute);
|
||||||
};
|
};
|
||||||
pipe([
|
pipe([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user