diff --git a/src/app/api/common/UserNotificationController.ts b/src/app/api/common/UserNotificationController.ts index 3450460e..eec01d06 100644 --- a/src/app/api/common/UserNotificationController.ts +++ b/src/app/api/common/UserNotificationController.ts @@ -25,8 +25,12 @@ export default class UserNotificationController extends ApiController { query = JSON.parse(req.query["q"] as string); } - query.where = { user: { uid: req.body.user.uid } }; - + if (query.where) { + query.where = { ...query.where, user: { uid: req.body.user.uid } }; + } else { + query.where = { user: { uid: req.body.user.uid } }; + } + query.include = { notification: true }; //call service to get prisma entity const userNotificationEntities = await this.userNotificationService.get(query);