From 82aa3cb4255bf859e17b199885feb82ccb85d867 Mon Sep 17 00:00:00 2001 From: yetmgetaewunetu Date: Sun, 5 Oct 2025 16:33:19 +0300 Subject: [PATCH] payload details fix backend --- api/src/gateway/gateway.service.ts | 6 +++++- .../dashboard/(components)/webhooks/webhook-docs.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api/src/gateway/gateway.service.ts b/api/src/gateway/gateway.service.ts index 93aa282..ec69c33 100644 --- a/api/src/gateway/gateway.service.ts +++ b/api/src/gateway/gateway.service.ts @@ -754,7 +754,11 @@ recipient, } // Update the SMS - const updatedSms = await this.smsModel.findByIdAndUpdate(dto.smsId, { $set: updateData }); +const updatedSms = await this.smsModel.findByIdAndUpdate( + dto.smsId, + { $set: updateData }, + { new: true } +); // Check if all SMS in batch have the same status, then update batch status if (dto.smsBatchId) { diff --git a/web/app/(app)/dashboard/(components)/webhooks/webhook-docs.tsx b/web/app/(app)/dashboard/(components)/webhooks/webhook-docs.tsx index 41b4930..5561c2b 100644 --- a/web/app/(app)/dashboard/(components)/webhooks/webhook-docs.tsx +++ b/web/app/(app)/dashboard/(components)/webhooks/webhook-docs.tsx @@ -27,17 +27,18 @@ const message_send_template = { recipient: "+123456789", deviceId: 'deviceId', webhookSubscriptionId: 'webhookSubscriptionId', - webhookEvent: 'sms.received', } const sms_delivered_payload = { ...message_send_template, sentAt: "datetime", deliveredAt: 'datetime', + webhookEvent: 'sms.delivered', } const sms_sent_payload = { ...message_send_template, - status: "sent" + status: "sent", + webhookEvent: 'sms.sent', } const sms_sent_failed = { @@ -45,7 +46,8 @@ const sms_sent_failed = { status: "failed", errorCode: "ErorCode", errorMessage: "Error", - failedAt: "datetime" + failedAt: "datetime", + webhookEvent: 'sms.send_failed', } const VERIFICATION_CODE = `