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 <noreply@anthropic.com>
This commit is contained in:
AFFAANh
2026-08-02 02:22:08 +05:30
co-authored by Claude Opus 5
parent 8145fcb52d
commit 72dcba1e6e
+5 -2
View File
@@ -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<string, unknown>;
advanced?: Record<string, unknown>;
channels?: string[];