forRoles IS NOT NULL, coalesce to empty=unrestricted

This commit is contained in:
наб 2025-07-22 00:26:05 +02:00
parent f3b5c3f447
commit b61c1d5b27
No known key found for this signature in database
GPG key ID: BCFD0B018D2658F1
9 changed files with 16 additions and 16 deletions

View file

@ -63,7 +63,7 @@ export class AnnouncementService {
}))
.andWhere(new Brackets(qb => {
qb.orWhere('announcement.forRoles && :roles', { roles: roles.map((r) => r.id) });
qb.orWhere('announcement.forRoles IS NULL');
qb.orWhere('announcement.forRoles = \'{}\'');
}))
.andWhere(`announcement.id NOT IN (${ readsQuery.getQuery() })`);