From 0c4032471dee53cf60379e833d7929179c53766b Mon Sep 17 00:00:00 2001 From: hofstede-matheus Date: Mon, 2 Oct 2023 23:07:16 -0300 Subject: [PATCH] make notification routes public --- .../usecases/CallNextClientOfDeskUsecase.ts | 12 ++++++------ .../typeorm/repositories/TypeOrmQueuesRepository.ts | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/modules/desk/interactors/usecases/CallNextClientOfDeskUsecase.ts b/src/modules/desk/interactors/usecases/CallNextClientOfDeskUsecase.ts index 4fbd600..a095c25 100644 --- a/src/modules/desk/interactors/usecases/CallNextClientOfDeskUsecase.ts +++ b/src/modules/desk/interactors/usecases/CallNextClientOfDeskUsecase.ts @@ -65,12 +65,12 @@ export class CallNextClientOfDeskUsecase implements UseCase { ); // TODO: notify queue subscriber - await this.notificationService.sendNotification( - client.queueId, - 'A fila andou', - 'A fila andou', - NotificationTypes.TO_TOPIC, - ); + // await this.notificationService.sendNotification( + // client.queueId, + // 'A fila andou', + // 'A fila andou', + // NotificationTypes.TO_TOPIC, + // ); // TODO: notify client when he is called const tokenFromClient = await this.clientRepository.getTokenFromClient( diff --git a/src/modules/queues/data/typeorm/repositories/TypeOrmQueuesRepository.ts b/src/modules/queues/data/typeorm/repositories/TypeOrmQueuesRepository.ts index e8a4070..8231b75 100644 --- a/src/modules/queues/data/typeorm/repositories/TypeOrmQueuesRepository.ts +++ b/src/modules/queues/data/typeorm/repositories/TypeOrmQueuesRepository.ts @@ -240,6 +240,8 @@ export class TypeOrmQueuesRepository implements QueueRepository { clients_position_in_queues.queue_id FROM clients_position_in_queues WHERE clients_position_in_queues.client_id = $1 + AND clients_position_in_queues.called_at IS NULL + `, [userId], );