update
This commit is contained in:
@@ -22,10 +22,10 @@ export class PagerListeners {
|
||||
// get admnin os restuaraant that have pager permissuins
|
||||
const admins = await this.adminService.findAdminsWithPermission(event.restaurantId, Permission.MANAGE_PAGER);
|
||||
const recipients = admins.map(admin => ({
|
||||
restaurantId: event.restaurantId,
|
||||
adminId: admin.id,
|
||||
}));
|
||||
await this.notificationService.sendNotification({
|
||||
restaurantId: event.restaurantId,
|
||||
message: {
|
||||
subject: NotifTitleEnum.PAGER_CREATED,
|
||||
body: `Your pager has created successfully`,
|
||||
|
||||
@@ -48,14 +48,14 @@ export class PagerService {
|
||||
}
|
||||
}
|
||||
const cookieId = userCookieId || ulid().toString();
|
||||
const existingPager = await this.em.findOne(Pager, {
|
||||
restaurant: { id: restaurant!.id },
|
||||
status: PagerStatus.Pending,
|
||||
cookieId,
|
||||
});
|
||||
if (existingPager) {
|
||||
throw new BadRequestException('Pager already exists');
|
||||
}
|
||||
// const existingPager = await this.em.findOne(Pager, {
|
||||
// restaurant: { id: restaurant!.id },
|
||||
// status: PagerStatus.Pending,
|
||||
// cookieId,
|
||||
// });
|
||||
// if (existingPager) {
|
||||
// throw new BadRequestException('Pager already exists');
|
||||
// }
|
||||
|
||||
const pager = this.em.create(Pager, {
|
||||
...createPagerDto,
|
||||
|
||||
Reference in New Issue
Block a user