api update whatsapp id too

This commit is contained in:
Ricardo Paes
2022-02-23 11:29:19 -03:00
parent acd628028e
commit a9739f3a65

View File

@@ -10,6 +10,7 @@ interface TicketData {
status?: string;
userId?: number;
queueId?: number;
whatsappId?: number;
}
interface Request {
@@ -27,7 +28,7 @@ const UpdateTicketService = async ({
ticketData,
ticketId
}: Request): Promise<Response> => {
const { status, userId, queueId } = ticketData;
const { status, userId, queueId, whatsappId } = ticketData;
const ticket = await ShowTicketService(ticketId);
await SetTicketMessagesAsRead(ticket);
@@ -46,6 +47,11 @@ const UpdateTicketService = async ({
});
if(whatsappId) {
await ticket.update({
whatsappId
});
}
await ticket.reload();