This commit is contained in:
2026-02-12 12:58:47 +03:30
parent dd49140273
commit 5525634475
3 changed files with 8 additions and 2 deletions
@@ -14,7 +14,6 @@ export class AdminRepository extends EntityRepository<Admin> {
const admins = await this.em.find( const admins = await this.em.find(
Admin, Admin,
{ roles: { shop: { id: shopId }, role: { permissions: { name: permission } } } }, { roles: { shop: { id: shopId }, role: { permissions: { name: permission } } } },
{ populate: ['roles', 'roles.role', 'roles.role.permissions'] },
); );
return admins; return admins;
} }
@@ -58,6 +58,8 @@ export class OrderListeners {
// get admnin os restuaraant that have order permissuins // get admnin os restuaraant that have order permissuins
const admins = await this.adminService.findAdminsWithPermission(event.shopId, Permission.MANAGE_ORDERS); const admins = await this.adminService.findAdminsWithPermission(event.shopId, Permission.MANAGE_ORDERS);
console.log(admins);
const recipients = admins.map(admin => ({ const recipients = admins.map(admin => ({
adminId: admin.id, adminId: admin.id,
})); }));
+6 -1
View File
@@ -5,4 +5,9 @@
2.3 after preapring order noti to user 2.3 after preapring order noti to user
2.4 after deliver to recipint notif to user 2.4 after deliver to recipint notif to user
2.5 after shiped => notif to user 2.5 after shiped => notif to user
2.6 2.6
Bugs :
1. after order creation sms not sent to admins