diff --git a/src/app/api/notary/UserNotificationController.ts b/src/app/api/notary/UserNotificationController.ts index 99921fa8..1654df3b 100644 --- a/src/app/api/notary/UserNotificationController.ts +++ b/src/app/api/notary/UserNotificationController.ts @@ -29,7 +29,7 @@ export default class UserNotificationController extends ApiController { const userId: string = req.body.user.userId; if(query.where?.user_uid) delete query.where.user_uid; - if(query.where?.user.uid) delete query.where.user.uid; + if(query.where?.user?.uid) delete query.where.user.uid; const notificationWhereInput: Prisma.UserNotificationsWhereInput = { ...query.where, user_uid: userId }; query.where = notificationWhereInput; @@ -67,8 +67,8 @@ export default class UserNotificationController extends ApiController { return; } - if(userNotificationFound.user_uid !== req.body.userId) { - this.httpForbidden(response, "You are allowed to update this user notification"); + if(userNotificationFound.user_uid !== req.body.user.userId) { + this.httpForbidden(response, "You are not allowed to update this user notification"); return; }