From 72dcba1e6e6ec4ad50cca1eb3fab3fa76d073fef Mon Sep 17 00:00:00 2001 From: AFFAANh Date: Sun, 2 Aug 2026 02:22:08 +0530 Subject: [PATCH] fix(campaigns): make budget and guardrails optional in CampaignPayload PUT /campaigns/{id} is a partial update on the backend, applying only the fields present in the body. Requiring budget and guardrails in the client type forced callers to resend both just to change a name. `name` stays required because the backend request model requires it on POST and PUT. Co-Authored-By: Claude Opus 5 --- src/api/types/campaign.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/types/campaign.ts b/src/api/types/campaign.ts index 6d7988b..115fc7d 100644 --- a/src/api/types/campaign.ts +++ b/src/api/types/campaign.ts @@ -54,8 +54,11 @@ export interface CampaignPayload { company_id?: string | null; objective?: string | null; ad_account_id?: string | null; - budget: CampaignBudget; - guardrails: CampaignGuardrails; + // Optional because PUT /campaigns/{id} is a partial update: the backend + // applies only the fields present in the body. `name` stays required + // because the backend's request model requires it on both POST and PUT. + budget?: CampaignBudget; + guardrails?: CampaignGuardrails; targeting?: Record; advanced?: Record; channels?: string[];