From 7c54a384465539ff8fe8fe9a70f795e906a8ad30 Mon Sep 17 00:00:00 2001 From: Guillaume Fay Date: Fri, 20 Sep 2024 13:42:37 +0200 Subject: [PATCH] fix: missing header content type --- src/lib/api-mes-adresses.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/api-mes-adresses.ts b/src/lib/api-mes-adresses.ts index b7bcf751b..2d697f58b 100644 --- a/src/lib/api-mes-adresses.ts +++ b/src/lib/api-mes-adresses.ts @@ -10,11 +10,13 @@ export async function getStatsBals(fields: string[], codeCommunes: string[]): Pr for (const field of fields) { url.searchParams.append('fields', field) } + const body = JSON.stringify({ codeCommunes }) return customFetch(url, { method: 'POST', - body: JSON.stringify({ - codeCommunes, - }), + body, + headers: { + 'Content-Type': 'application/json', + }, }) }