diff --git a/src/controllers/00-notification-controller.ts b/src/controllers/00-notification-controller.ts index 8a953af..4f00bcf 100644 --- a/src/controllers/00-notification-controller.ts +++ b/src/controllers/00-notification-controller.ts @@ -59,9 +59,13 @@ export class NotificationController extends Controller { }, ], NOT: { - readByUser: { some: { id: req.user.sub } }, - deleteByUser: { some: { id: req.user.sub } }, - createdAt: { lte: dayjs().subtract(7, "days").toDate() }, + OR: [ + { + readByUser: { some: { id: req.user.sub } }, + createdAt: { lte: dayjs().subtract(7, "days").toDate() }, + }, + { deleteByUser: { some: { id: req.user.sub } } }, + ], }, }; const [result, total] = await prisma.$transaction([ @@ -166,7 +170,7 @@ export class NotificationController extends Controller { where: { id: notificationId }, data: { deleteByUser: { - disconnect: { id: req.user.sub }, + connect: { id: req.user.sub }, }, }, });