Skip to content

Commit 63b0c1f

Browse files
authored
chore: Update uniform-workflow-transition-webhook.ts (#241)
1 parent 3c97520 commit 63b0c1f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/tms-webhook-smartling/src/pages/api/uniform-workflow-transition-webhook.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
7272
// You can find full payload structure under Uniform Project -> Settings -> Webhooks => Event Catalog
7373
const payloadObject: WorkflowTransitionPayload = req.body;
7474

75+
if (!payloadObject.newStage) {
76+
throw new Error("No newStage data in payloadObject: " + JSON.stringify(payloadObject));
77+
}
78+
7579
if (payloadObject.newStage.stageId === uniformWorkflowStageIdReadyForTranslations) {
7680
const { entity, translationEntityType } = await resolveUniformEntityFromWebhook(payloadObject);
7781

0 commit comments

Comments
 (0)