Skip to content

Commit fb965e9

Browse files
committed
Remove assigned tickets from clearqueue
1 parent e73ddca commit fb965e9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/components/queue/TicketQueue.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,9 @@ const TicketQueue = (props: TicketQueueProps) => {
228228
context.ticket.getTicketsWithStatus.invalidate();
229229
};
230230

231-
const totalTicketsLength =
231+
const totalNonAssignedTicketsLength =
232232
getTickets(TicketStatus.OPEN).length +
233233
getTickets(TicketStatus.PENDING).length +
234-
getTickets(TicketStatus.ASSIGNED).length +
235234
getTickets(TicketStatus.ABSENT).length;
236235

237236
return (
@@ -242,7 +241,7 @@ const TicketQueue = (props: TicketQueueProps) => {
242241
Queue is currently closed
243242
</Text>
244243
<Button
245-
hidden={totalTicketsLength === 0 || userRole !== UserRole.STAFF}
244+
hidden={totalNonAssignedTicketsLength === 0 || userRole !== UserRole.STAFF}
246245
onClick={clearQueue}
247246
ml={5}
248247
colorScheme='green'

src/server/trpc/router/ticket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ export const ticketRouter = router({
588588
const tickets = await ctx.prisma.ticket.findMany({
589589
where: {
590590
status: {
591-
in: [TicketStatus.OPEN, TicketStatus.PENDING, TicketStatus.ASSIGNED, TicketStatus.ABSENT],
591+
in: [TicketStatus.OPEN, TicketStatus.PENDING, TicketStatus.ABSENT],
592592
},
593593
...(input.personalQueueName ? { personalQueueName: input.personalQueueName } : { personalQueueName: null }),
594594
},

0 commit comments

Comments
 (0)