fix not being able to create any dialog announcements

This commit is contained in:
bunnybeam 2025-07-23 20:49:51 +01:00
parent ec62953224
commit 47f44a0d4c
No known key found for this signature in database

View file

@ -72,6 +72,7 @@ export class AnnouncementService {
// Check how many active dialog queries already exist, to enforce a limit
const query = this.announcementsRepository.createQueryBuilder('announcement');
query.andWhere('announcement.isActive = true');
query.andWhere('announcement.display = \'dialog\'');
const count = await query.getCount();
if (count >= 5) {
throw new IdentifiableError('c0d15f15-f18e-4a40-bcb1-f310d58204ee', 'Too many dialog announcements.');
@ -136,6 +137,7 @@ export class AnnouncementService {
// Check how many active dialog queries already exist, to enforce a limit
const query = this.announcementsRepository.createQueryBuilder('announcement');
query.andWhere('announcement.isActive = true');
query.andWhere('announcement.display = \'dialog\'');
const count = await query.getCount();
if (count >= 5) {
throw new IdentifiableError('c0d15f15-f18e-4a40-bcb1-f310d58204ee', 'Too many dialog announcements.');