fix: Resolve report error at supervisor level in frontend

pull/22/head
adriano 2024-02-01 18:38:30 -03:00
parent 09a469e892
commit 21b19fcfbd
1 changed files with 2 additions and 2 deletions

View File

@ -338,9 +338,9 @@ const Report = () => {
let userQueues = userA.queues; let userQueues = userA.queues;
let filterQueuesTickets = []; let filterQueuesTickets = [];
if(userQueues.length > 1){ if(userQueues.length > 1){
filterQueuesTickets = ticketsQueue.filter(ticket => userQueues.some(queue => queue.name === ticket.queue.name)); filterQueuesTickets = ticketsQueue.filter(ticket => userQueues.some(queue => queue?.name === ticket?.queue?.name));
}else if(userQueues.length > 0) { }else if(userQueues.length > 0) {
filterQueuesTickets = ticketsQueue.filter(ticket => ticket.queue.name === userQueues[0].name); filterQueuesTickets = ticketsQueue.filter(ticket => ticket?.queue?.name === userQueues[0]?.name);
} }
data.tickets = filterQueuesTickets; data.tickets = filterQueuesTickets;
dispatchQ({ type: "LOAD_QUERY", payload: data.tickets }) dispatchQ({ type: "LOAD_QUERY", payload: data.tickets })