From 13b8dd895a2597dbb18044e67a199e66dc859009 Mon Sep 17 00:00:00 2001 From: m5r Date: Sat, 28 Aug 2021 14:16:14 +0800 Subject: [PATCH] fix insert messages queue, insert messages with an id and no unnecessary field --- app/messages/api/queue/insert-messages.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/messages/api/queue/insert-messages.ts b/app/messages/api/queue/insert-messages.ts index c36577b..6a500fe 100644 --- a/app/messages/api/queue/insert-messages.ts +++ b/app/messages/api/queue/insert-messages.ts @@ -22,7 +22,8 @@ const insertMessagesQueue = Queue( } const sms = messages - .map>((message) => ({ + .map((message) => ({ + id: message.sid, organizationId, phoneNumberId: phoneNumber.id, content: encrypt(message.body, phoneNumber.organization.encryptionKey), @@ -30,7 +31,6 @@ const insertMessagesQueue = Queue( to: message.to, status: translateStatus(message.status), direction: translateDirection(message.direction), - twilioSid: message.sid, sentAt: new Date(message.dateCreated), })) .sort((a, b) => a.sentAt.getTime() - b.sentAt.getTime());