fix(backend): お知らせのページネーションが機能しない #11800 (#11890)

* fix(backend): お知らせのページネーションが機能しない #11800

* Update CHANGELOG
This commit is contained in:
taichan 2023-09-24 20:08:00 +09:00 committed by GitHub
parent 281369d8c5
commit dc8ab01168
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -12,6 +12,16 @@
--> -->
## (unreleased)
### General
-
### Client
-
### Server
- Fix: お知らせのページネーションが機能しない
## 2023.9.0 (unreleased) ## 2023.9.0 (unreleased)
### Note ### Note

View File

@ -52,7 +52,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId)
.where('announcement.isActive = :isActive', { isActive: ps.isActive }) .andWhere('announcement.isActive = :isActive', { isActive: ps.isActive })
.andWhere(new Brackets(qb => { .andWhere(new Brackets(qb => {
if (me) qb.orWhere('announcement.userId = :meId', { meId: me.id }); if (me) qb.orWhere('announcement.userId = :meId', { meId: me.id });
qb.orWhere('announcement.userId IS NULL'); qb.orWhere('announcement.userId IS NULL');