From 335e4bd213d23849ecff193e1143a322bf201708 Mon Sep 17 00:00:00 2001 From: xianon Date: Sun, 28 Nov 2021 13:45:17 +0900 Subject: [PATCH] =?UTF-8?q?/antennas/notes=20API=20=E3=81=A7=E6=97=A5?= =?UTF-8?q?=E4=BB=98=E3=81=AB=E3=82=88=E3=82=8B=E7=B5=9E=E3=82=8A=E8=BE=BC?= =?UTF-8?q?=E3=81=BF=E3=81=8C=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B=20(#8015)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/antennas/notes.ts | 11 ++++++++++- 1 file changed, 10 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 1759e95b4c..02fec2778b 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -33,6 +33,14 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, + + sinceDate: { + validator: $.optional.num, + }, + + untilDate: { + validator: $.optional.num, + }, }, errors: { @@ -68,7 +76,8 @@ export default define(meta, async (ps, user) => { .select('joining.noteId') .where('joining.antennaId = :antennaId', { antennaId: antenna.id }); - const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId) + const query = makePaginationQuery(Notes.createQueryBuilder('note'), + ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere(`note.id IN (${ antennaQuery.getQuery() })`) .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply')