From 1de54fb1ce5c9ee3cc199f7f45d8afd8ecf096ca Mon Sep 17 00:00:00 2001 From: OxSaitama Date: Fri, 29 Sep 2023 11:54:25 +0200 Subject: [PATCH] fix update notification --- src/app/api/notary/UserNotificationController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }