mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 20:59:16 +00:00
✨ api update whatsapp id too
This commit is contained in:
@@ -10,6 +10,7 @@ interface TicketData {
|
|||||||
status?: string;
|
status?: string;
|
||||||
userId?: number;
|
userId?: number;
|
||||||
queueId?: number;
|
queueId?: number;
|
||||||
|
whatsappId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Request {
|
interface Request {
|
||||||
@@ -27,7 +28,7 @@ const UpdateTicketService = async ({
|
|||||||
ticketData,
|
ticketData,
|
||||||
ticketId
|
ticketId
|
||||||
}: Request): Promise<Response> => {
|
}: Request): Promise<Response> => {
|
||||||
const { status, userId, queueId } = ticketData;
|
const { status, userId, queueId, whatsappId } = ticketData;
|
||||||
|
|
||||||
const ticket = await ShowTicketService(ticketId);
|
const ticket = await ShowTicketService(ticketId);
|
||||||
await SetTicketMessagesAsRead(ticket);
|
await SetTicketMessagesAsRead(ticket);
|
||||||
@@ -46,6 +47,11 @@ const UpdateTicketService = async ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if(whatsappId) {
|
||||||
|
await ticket.update({
|
||||||
|
whatsappId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await ticket.reload();
|
await ticket.reload();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user