mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-14 01:50:45 +01:00
/antennas/notes API で日付による絞り込みができるようにする (#8015)
This commit is contained in:
parent
0d21083c9a
commit
335e4bd213
1 changed files with 10 additions and 1 deletions
|
@ -33,6 +33,14 @@ export const meta = {
|
||||||
untilId: {
|
untilId: {
|
||||||
validator: $.optional.type(ID),
|
validator: $.optional.type(ID),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
sinceDate: {
|
||||||
|
validator: $.optional.num,
|
||||||
|
},
|
||||||
|
|
||||||
|
untilDate: {
|
||||||
|
validator: $.optional.num,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
errors: {
|
errors: {
|
||||||
|
@ -68,7 +76,8 @@ export default define(meta, async (ps, user) => {
|
||||||
.select('joining.noteId')
|
.select('joining.noteId')
|
||||||
.where('joining.antennaId = :antennaId', { antennaId: antenna.id });
|
.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() })`)
|
.andWhere(`note.id IN (${ antennaQuery.getQuery() })`)
|
||||||
.innerJoinAndSelect('note.user', 'user')
|
.innerJoinAndSelect('note.user', 'user')
|
||||||
.leftJoinAndSelect('note.reply', 'reply')
|
.leftJoinAndSelect('note.reply', 'reply')
|
||||||
|
|
Loading…
Reference in a new issue