fix update notification
This commit is contained in:
parent
8334d0c67f
commit
1de54fb1ce
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user