From 9f33ce1cd0eafb744647dab33f3e8087800dd3b4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 10 Oct 2023 09:45:40 +0900 Subject: [PATCH] fix of 0bb0c32908 --- packages/backend/src/server/api/endpoints/antennas/notes.ts | 6 +++++- packages/backend/test/utils.ts | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/antennas/notes.ts b/packages/backend/src/server/api/endpoints/antennas/notes.ts index 1a78bf26d..6d69971e3 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -109,7 +109,11 @@ export default class extends Endpoint { // eslint- this.queryService.generateBlockedUserQuery(query, me); const notes = await query.getMany(); - notes.sort((a, b) => a.id > b.id ? -1 : 1); + if (sinceId != null && untilId == null) { + notes.sort((a, b) => a.id < b.id ? -1 : 1); + } else { + notes.sort((a, b) => a.id > b.id ? -1 : 1); + } if (notes.length > 0) { this.noteReadService.read(me.id, notes); diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index 738635dae..97118d73c 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -457,6 +457,7 @@ export async function testPaginationConsistency id + ':' + createdAt), expected.map(({ id, createdAt }) => id + ':' + createdAt)); } + */ // 3. untilId指定+limitで取得してつなぎ合わせた結果が期待通りになっていること if (ordering === 'desc') {