fix(server): correct notification pagination by using 'lt' instead of 'gt' for createdAt (#11430)

This commit is contained in:
fengmk2
2025-04-03 01:25:35 +00:00
parent bd5428e311
commit a5eb1b9985
2 changed files with 12 additions and 29 deletions
@@ -209,7 +209,7 @@ export class NotificationModel extends BaseModel {
where: {
userId,
...(options?.includeRead ? {} : { read: false }),
...(options?.after ? { createdAt: { gt: options.after } } : {}),
...(options?.after ? { createdAt: { lt: options.after } } : {}),
},
orderBy: { createdAt: 'desc' },
skip: options?.offset,