Fixing notifications

This commit is contained in:
Maxime Lalo 2023-09-26 12:08:19 +02:00
parent 52f10c5c01
commit c6c37621c4

View File

@ -25,8 +25,12 @@ export default class UserNotificationController extends ApiController {
query = JSON.parse(req.query["q"] as string); 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 //call service to get prisma entity
const userNotificationEntities = await this.userNotificationService.get(query); const userNotificationEntities = await this.userNotificationService.get(query);