diff --git a/changes/30066-policy-autofill-media-type b/changes/30066-policy-autofill-media-type new file mode 100644 index 0000000000..1b06b0bf47 --- /dev/null +++ b/changes/30066-policy-autofill-media-type @@ -0,0 +1 @@ +Fixed policy autofill using incorrect media-type for query diff --git a/frontend/services/entities/autofill.ts b/frontend/services/entities/autofill.ts index d1b49a6619..c52504da50 100644 --- a/frontend/services/entities/autofill.ts +++ b/frontend/services/entities/autofill.ts @@ -10,9 +10,6 @@ export default { getPolicyInterpretationFromSQL: (sql: string): Promise => { const { AUTOFILL_POLICY } = endpoints; - // API expects JSON object with key "sql" - const data = JSON.stringify({ sql }); - - return sendRequest("POST", AUTOFILL_POLICY, data); + return sendRequest("POST", AUTOFILL_POLICY, { sql }); }, };