From 96c748f80786bc970effea5a9638f7c9445896f4 Mon Sep 17 00:00:00 2001 From: Natty Date: Mon, 1 Jan 2024 21:10:20 +0100 Subject: [PATCH] Sort notifications by createdAt --- packages/backend/src/server/api/endpoints/i/notifications.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 845e4a0fe4..a434f980ce 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -37,6 +37,8 @@ export const paramDef = { limit: { type: "integer", minimum: 1, maximum: 100, default: 10 }, sinceId: { type: "string", format: "misskey:id" }, untilId: { type: "string", format: "misskey:id" }, + sinceDate: { type: "integer" }, + untilDate: { type: "integer" }, following: { type: "boolean", default: false }, unreadOnly: { type: "boolean", default: false }, markAsRead: { type: "boolean", default: true }, @@ -87,6 +89,8 @@ export default define(meta, paramDef, async (ps, user) => { Notifications.createQueryBuilder("notification"), ps.sinceId, ps.untilId, + ps.sinceDate, + ps.untilDate ) .andWhere("notification.notifieeId = :meId", { meId: user.id }) .leftJoinAndSelect("notification.notifier", "notifier")