fix(campaigns): start_date modal + hide future-campaign tests from queue

Backend: activate endpoint returns 409 with structured warning when
start_date is in the future; accepts force=true to bypass.
test_crud_service: always excludes tests from draft campaigns with future
start_date so they do not appear in the team queue prematurely.

Frontend: catches 409 on activate and shows amber confirmation modal
with Keep scheduled / Activate now anyway options.
This commit is contained in:
kitos
2026-06-04 14:05:58 +02:00
parent 27c67a5f76
commit 6b1f5d690a
4 changed files with 91 additions and 19 deletions
+6 -2
View File
@@ -134,8 +134,12 @@ export async function removeTestFromCampaign(
}
/** Activate a campaign. */
export async function activateCampaign(campaignId: string): Promise<Campaign> {
const { data } = await client.post<Campaign>(`/campaigns/${campaignId}/activate`);
export async function activateCampaign(
campaignId: string,
options?: { force?: boolean },
): Promise<Campaign> {
const params = options?.force ? "?force=true" : "";
const { data } = await client.post<Campaign>(`/campaigns/${campaignId}/activate${params}`);
return data;
}