mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
feat: finished queue filter on tickets list
This commit is contained in:
@@ -63,7 +63,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
|
||||
const io = getIO();
|
||||
io.to(ticket.status).emit("ticket", {
|
||||
action: "create",
|
||||
action: "update",
|
||||
ticket
|
||||
});
|
||||
|
||||
@@ -100,7 +100,7 @@ export const update = async (
|
||||
}
|
||||
|
||||
io.to(ticket.status).to("notification").to(ticketId).emit("ticket", {
|
||||
action: "updateStatus",
|
||||
action: "update",
|
||||
ticket
|
||||
});
|
||||
|
||||
|
||||
@@ -34,12 +34,6 @@ const ListTicketsService = async ({
|
||||
userId,
|
||||
withUnreadMessages
|
||||
}: Request): Promise<Response> => {
|
||||
// const user = await ShowUserService(userId);
|
||||
|
||||
// const userQueueIds = user.queues.map(queue => queue.id);
|
||||
|
||||
// console.log(userQueueIds);
|
||||
|
||||
let whereCondition: Filterable["where"] = {
|
||||
[Op.or]: [{ userId }, { status: "pending" }],
|
||||
queueId: { [Op.or]: [queueIds, null] }
|
||||
@@ -60,7 +54,7 @@ const ListTicketsService = async ({
|
||||
];
|
||||
|
||||
if (showAll === "true") {
|
||||
whereCondition = {};
|
||||
whereCondition = { queueId: { [Op.or]: [queueIds, null] } };
|
||||
}
|
||||
|
||||
if (status) {
|
||||
@@ -92,6 +86,7 @@ const ListTicketsService = async ({
|
||||
];
|
||||
|
||||
whereCondition = {
|
||||
...whereCondition,
|
||||
[Op.or]: [
|
||||
{
|
||||
"$contact.name$": where(
|
||||
|
||||
Reference in New Issue
Block a user