This commit is contained in:
2025-12-12 22:42:58 +03:30
parent 10e13c7901
commit 0434329db6
5 changed files with 42 additions and 36 deletions
@@ -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`,
+8 -8
View File
@@ -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,