fix: Allow changing audience type after creation of campaign
This commit is contained in:
@@ -220,7 +220,21 @@ export default function CampaignDetailsPage() {
|
||||
});
|
||||
// Silent save - no toast notification
|
||||
setHasChanges(false);
|
||||
void mutate();
|
||||
// Refetch and re-sync the edited campaign with fresh data
|
||||
const updated = await mutate();
|
||||
if (updated?.data) {
|
||||
setEditedCampaign({
|
||||
name: updated.data.name,
|
||||
description: updated.data.description || '',
|
||||
subject: updated.data.subject,
|
||||
body: updated.data.body,
|
||||
from: updated.data.from,
|
||||
fromName: updated.data.fromName || '',
|
||||
replyTo: updated.data.replyTo || '',
|
||||
audienceType: updated.data.audienceType,
|
||||
segmentId: updated.data.segmentId || undefined,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
toast.error(error instanceof Error ? error.message : 'Failed to update campaign');
|
||||
} finally {
|
||||
@@ -497,11 +511,6 @@ export default function CampaignDetailsPage() {
|
||||
title="Segment"
|
||||
description="Target a defined group of contacts"
|
||||
/>
|
||||
<SelectItemWithDescription
|
||||
value={CampaignAudienceType.FILTERED}
|
||||
title="Filtered"
|
||||
description="Use advanced filter conditions"
|
||||
/>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user