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
+2 -2
View File
@@ -180,12 +180,12 @@ export class SegmentService {
// First verify segment exists and belongs to project
await this.get(projectId, segmentId);
// Check if segment is used in any campaigns
// Check if segment is used in any active campaigns
const campaignsUsingSegment = await prisma.campaign.count({
where: {
segmentId,
status: {
not: 'SENT', // Allow deletion if all campaigns using it are completed
in: ['DRAFT', 'SCHEDULED', 'SENDING'],
},
},
});