Refactorings, error handling and logout

This commit is contained in:
Dries Augustyns
2025-12-03 20:39:11 +01:00
parent 113b94cf2c
commit 382e97e5b2
12 changed files with 306 additions and 189 deletions
+5
View File
@@ -116,6 +116,11 @@ export class CampaignService {
}
if (data.segmentId !== undefined) {
// Prevent changing segment on scheduled campaigns
if (campaign.status === CampaignStatus.SCHEDULED) {
throw new HttpException(400, 'Cannot change segment for scheduled campaigns');
}
if (data.segmentId) {
const segment = await prisma.segment.findFirst({
where: {id: data.segmentId, projectId},