chore: cleanup

This commit is contained in:
Jamie Howard 2023-06-27 16:14:44 +01:00
parent 5985781a9a
commit 7ff725ed6c

View File

@ -69,8 +69,9 @@ const decorator = (service) => ({
const previousStage = await getEntityStage(uid, entityId);
const updatedEntity = await service.update.call(this, uid, entityId, { ...opts, data });
const updatedStage = updatedEntity[ENTITY_STAGE_ATTRIBUTE];
if (previousStage?.id && previousStage.id !== updatedEntity[ENTITY_STAGE_ATTRIBUTE].id) {
if (previousStage?.id && previousStage.id !== updatedStage.id) {
const model = strapi.getModel(uid);
strapi.eventHub.emit(WORKFLOW_UPDATE_STAGE, {
@ -87,8 +88,8 @@ const decorator = (service) => ({
name: previousStage.name,
},
to: {
id: updatedEntity[ENTITY_STAGE_ATTRIBUTE].id,
name: updatedEntity[ENTITY_STAGE_ATTRIBUTE].name,
id: updatedStage.id,
name: updatedStage.name,
},
},
},