payment
This commit is contained in:
@@ -4,8 +4,6 @@ import {
|
||||
// SubscribeMessage,
|
||||
OnGatewayConnection,
|
||||
OnGatewayDisconnect,
|
||||
// MessageBody,
|
||||
// ConnectedSocket,
|
||||
} from '@nestjs/websockets';
|
||||
import { Server, Socket } from 'socket.io';
|
||||
import { Logger, Inject, forwardRef } from '@nestjs/common';
|
||||
@@ -70,8 +68,8 @@ export class NotificationsGateway implements OnGatewayConnection, OnGatewayDisco
|
||||
// }
|
||||
}
|
||||
|
||||
sendInAppNotification(repipient: { adminId: string; : string }, payload: IInAppNotificationPayload) {
|
||||
const room = this.getRoom(repipient.adminId, repipient.);
|
||||
sendInAppNotification(repipient: { adminId: string; }, payload: IInAppNotificationPayload) {
|
||||
const room = this.getRoom(repipient.adminId,);
|
||||
|
||||
this.logger.log(`Sending in app notification to admin: ${repipient.adminId}`);
|
||||
this.server.to(room).emit('notifications', payload, async () => {
|
||||
@@ -81,19 +79,19 @@ export class NotificationsGateway implements OnGatewayConnection, OnGatewayDisco
|
||||
this.logger.log(`In app notification sent to admin: ${repipient.adminId}`);
|
||||
}
|
||||
|
||||
private getRoom(adminId: string, : string) {
|
||||
return `restaurant:${}-admin:${adminId}`;
|
||||
private getRoom(adminId: string,) {
|
||||
return `admin:${adminId}`;
|
||||
}
|
||||
|
||||
handleLeaveRoom(client: AuthenticatedSocket) {
|
||||
const room = this.getRoom(client.adminId!, client.!);
|
||||
const room = this.getRoom(client.adminId!,);
|
||||
void client.leave(room);
|
||||
this.logger.log(`Admin ${client.adminId} (Client ${client.id}) left room: ${room}`);
|
||||
void client.emit('left', { room, message: 'Successfully Admin left room' });
|
||||
}
|
||||
|
||||
handleJoinRoom(client: AuthenticatedSocket) {
|
||||
const room = this.getRoom(client.adminId!, client.!);
|
||||
const room = this.getRoom(client.adminId!,);
|
||||
void client.join(room);
|
||||
this.logger.log(`Admin ${client.adminId} (Client ${client.id}) joined room: ${room}`);
|
||||
void client.emit('joined', { room, message: 'Successfully Admin joined room' });
|
||||
|
||||
Reference in New Issue
Block a user