From 51fd8b4232ba182fa9b4ae84d1c28398effc3ba5 Mon Sep 17 00:00:00 2001 From: gustavo-gsp Date: Fri, 14 Jun 2024 12:18:15 -0300 Subject: [PATCH] fix: return queue on POST /ticket --- backend/src/controllers/TicketController.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/controllers/TicketController.ts b/backend/src/controllers/TicketController.ts index a54ed06..d697b63 100644 --- a/backend/src/controllers/TicketController.ts +++ b/backend/src/controllers/TicketController.ts @@ -380,6 +380,14 @@ export const store = async (req: Request, res: Response): Promise => { }); } + const queueQuery: any = await Queue.findOne({ + where: { id: queueId }, + attributes: ["id", "name", "color"], + raw: true + }); + + ticket.dataValues.queue = queueQuery + const io = getIO(); io.to(ticket.status).emit("ticket", { action: "update",