notification queue
This commit is contained in:
@@ -41,18 +41,14 @@ export class NotificationService {
|
||||
|
||||
// send in app notification
|
||||
if (preference?.channels?.includes(NotifChannelEnum.IN_APP)) {
|
||||
notifications.forEach(notif => {
|
||||
if (notif.admin) {
|
||||
this.notificationGateway.sendInAppNotification(
|
||||
{ adminId: notif.admin.id, restaurantId },
|
||||
{
|
||||
notificationId: notif.id,
|
||||
subject: message.title,
|
||||
body: message.content,
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
await this.queueService.addBulkInAppNotifications(
|
||||
notifications.map(notification => ({
|
||||
recipient: { adminId: notification.admin?.id || '', restaurantId },
|
||||
subject: message.title,
|
||||
body: message.content,
|
||||
notificationId: notification.id,
|
||||
})),
|
||||
);
|
||||
}
|
||||
// add sms notifications to queue
|
||||
if (preference?.channels?.includes(NotifChannelEnum.SMS)) {
|
||||
|
||||
Reference in New Issue
Block a user