Skip to content

Commit

Permalink
optimising the tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Sep 7, 2024
1 parent b665d1f commit 05f3894
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/features/gateway/gatway.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,20 +250,20 @@ export class GateWayController implements OnModuleInit {
}
}

@UseFilters(new BadRequestTransformationFilter())
@UsePipes(new ValidationPipe())
@SubscribeMessage('leave:room')
async onLeaveRoom(
@MessageBody(ValidateGatewayPipe) body: CreateJoinRoomDto,
@ConnectedSocket() client: Socket,
) {
if (this.socket.connected) {
const { ticket } = await this.ticketService.getTicketById(
body.ticketId,
body.flaskUserId,
);
console.log('\x1b[36m%s\x1b[0m', `leaving room:${ticket.id}...\n`);
client.leave(`room:${ticket.id}`);
}
}
// @UseFilters(new BadRequestTransformationFilter())
// @UsePipes(new ValidationPipe())
// @SubscribeMessage('leave:room')
// async onLeaveRoom(
// @MessageBody(ValidateGatewayPipe) body: CreateJoinRoomDto,
// @ConnectedSocket() client: Socket,
// ) {
// if (this.socket.connected) {
// const { ticket } = await this.ticketService.getTicketById(
// body.ticketId,
// body.flaskUserId,
// );
// console.log('\x1b[36m%s\x1b[0m', `leaving room:${ticket.id}...\n`);
// client.leave(`room:${ticket.id}`);
// }
// }
}

0 comments on commit 05f3894

Please sign in to comment.