diff --git a/src/cli/commands/corps-bind.test.ts b/src/cli/commands/corps-bind.test.ts index 2caa603..37bd59d 100644 --- a/src/cli/commands/corps-bind.test.ts +++ b/src/cli/commands/corps-bind.test.ts @@ -302,9 +302,9 @@ describe("corps sync-test", () => { expect(parsed.productionGuarantees.prodRulesStayDraft).toBe(true); expect(parsed.productionGuarantees.prodVersionPublished).toBe(false); - const patchPref = requests.find((r) => r.method === "PATCH" && r.path.includes("config")); - expect(patchPref).toBeDefined(); - expect((patchPref?.body as any).decisionPreferences?.explicitApprove).toBe("Prod approve note"); + const postPref = requests.find((r) => (r.method === "POST" || r.method === "PATCH") && r.path.includes("config")); + expect(postPref).toBeDefined(); + expect((postPref?.body as any).decisionPreferences?.explicitApprove).toBe("Prod approve note"); const deleteRule = requests.find((r) => r.method === "DELETE" && r.path === "/api/v1/rules/test-rule-old"); expect(deleteRule).toBeDefined(); @@ -402,10 +402,10 @@ function mockSealSyncRequests(options: { }); } - if (url.pathname === "/api/v1/agent/ai-approval/config" && method === "PATCH") { + if (url.pathname === "/api/v1/agent/ai-approval/config" && (method === "POST" || method === "PATCH")) { const body = JSON.parse(rawBody || "{}"); - options.onMutation?.("PATCH", url.pathname, body); - return jsonResponse({ data: body }); + options.onMutation?.(method, url.pathname, body); + return jsonResponse({ data: { success: true } }); } if (url.pathname === "/api/v1/rules" && method === "GET") { diff --git a/src/domains/seal/api.ts b/src/domains/seal/api.ts index cd37357..6446c74 100644 --- a/src/domains/seal/api.ts +++ b/src/domains/seal/api.ts @@ -274,10 +274,8 @@ export async function updateApprovalStylePreferences( params: Record, endpoint = "api/v1/agent/ai-approval/config" ): Promise { - return unwrap( - await client.patch(endpoint, { json: params }), - ApprovalStylePreferencesSchema - ); + await client.post(endpoint, { json: params }); + return getApprovalStylePreferences(client, endpoint); } export type WebhookMutationPreview = {