mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
feature(ee): modify webhook payload
This commit is contained in:
parent
9e4bf7f97b
commit
f05762e2e8
@ -54,7 +54,16 @@ const decorator = (service) => ({
|
||||
|
||||
const updatedEntity = await service.update.call(this, uid, entityId, { ...opts, data });
|
||||
if (previousStageId && previousStageId !== data[ENTITY_STAGE_ATTRIBUTE]) {
|
||||
await service.emitEvent.call(this, uid, WORKFLOW_UPDATE_STAGE, updatedEntity);
|
||||
const webhookPayload = {
|
||||
entityId,
|
||||
workflow: {
|
||||
stages: {
|
||||
from: previousStageId,
|
||||
to: data[ENTITY_STAGE_ATTRIBUTE],
|
||||
},
|
||||
},
|
||||
};
|
||||
await service.emitEvent.call(this, uid, WORKFLOW_UPDATE_STAGE, webhookPayload);
|
||||
}
|
||||
|
||||
return updatedEntity;
|
||||
|
Loading…
x
Reference in New Issue
Block a user