mirror of
https://github.com/strapi/strapi.git
synced 2025-08-07 08:16:35 +00:00
fix(ee): update order mistake
This commit is contained in:
parent
ed5fe3766d
commit
9e4bf7f97b
@ -47,13 +47,12 @@ const decorator = (service) => ({
|
|||||||
return service.update.call(this, uid, entityId, { ...opts, data });
|
return service.update.call(this, uid, entityId, { ...opts, data });
|
||||||
}
|
}
|
||||||
|
|
||||||
const updatedEntity = await service.update.call(this, uid, entityId, { ...opts, data });
|
|
||||||
|
|
||||||
const entity = await service.findOne.call(this, uid, entityId, {
|
const entity = await service.findOne.call(this, uid, entityId, {
|
||||||
populate: [ENTITY_STAGE_ATTRIBUTE],
|
populate: [ENTITY_STAGE_ATTRIBUTE],
|
||||||
});
|
});
|
||||||
const previousStageId = entity?.[ENTITY_STAGE_ATTRIBUTE]?.id ?? null;
|
const previousStageId = entity?.[ENTITY_STAGE_ATTRIBUTE]?.id ?? null;
|
||||||
|
|
||||||
|
const updatedEntity = await service.update.call(this, uid, entityId, { ...opts, data });
|
||||||
if (previousStageId && previousStageId !== data[ENTITY_STAGE_ATTRIBUTE]) {
|
if (previousStageId && previousStageId !== data[ENTITY_STAGE_ATTRIBUTE]) {
|
||||||
await service.emitEvent.call(this, uid, WORKFLOW_UPDATE_STAGE, updatedEntity);
|
await service.emitEvent.call(this, uid, WORKFLOW_UPDATE_STAGE, updatedEntity);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user