Compare commits

..

3 Commits

Author SHA1 Message Date
gustavo-gsp 51fd8b4232 fix: return queue on POST /ticket 2024-06-14 12:18:15 -03:00
gustavo-gsp b5f9fbc558 fix: return pageNumber value on GET /tickets 2024-06-14 12:16:59 -03:00
gustavo-gsp c3452c72d7 fix: change endpoint to verify client existance 2024-06-14 12:15:58 -03:00
2 changed files with 10 additions and 2 deletions

View File

@ -118,7 +118,7 @@ export const index = async (req: Request, res: Response): Promise<Response> => {
return res return res
.status(200) .status(200)
.json({ tickets, count, hasMore, remoteTicketsControll }); .json({ tickets, count, hasMore, remoteTicketsControll, pageNumber });
}; };
export const remoteTicketCreation = async ( export const remoteTicketCreation = async (
@ -380,6 +380,14 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
}); });
} }
const queueQuery: any = await Queue.findOne({
where: { id: queueId },
attributes: ["id", "name", "color"],
raw: true
});
ticket.dataValues.queue = queueQuery
const io = getIO(); const io = getIO();
io.to(ticket.status).emit("ticket", { io.to(ticket.status).emit("ticket", {
action: "update", action: "update",

View File

@ -19,7 +19,7 @@ const clientExistsCache = cache<boolean>(CLIENT_EXISTS_CACHE_TTL);
export const clientExists = async (id: string): Promise<boolean> => { export const clientExists = async (id: string): Promise<boolean> => {
const fetcher = async (id: string) => { const fetcher = async (id: string) => {
const response = await fetchWithKey(`/clients/${id}`, { method: "HEAD" }); const response = await fetchWithKey(`/tenants/${id}`, { method: "HEAD" });
await responseOk(response); await responseOk(response);