diff --git a/formulaire/pages/api/dossier/[id].tsx b/formulaire/pages/api/dossier/[id].tsx index 134383c13..2553879c4 100644 --- a/formulaire/pages/api/dossier/[id].tsx +++ b/formulaire/pages/api/dossier/[id].tsx @@ -41,7 +41,7 @@ const remove: NextApiHandler = async (req, res) => { const url = `${process.env.API_URL_INSTRUCTEUR}/inc/dossiers/${dossierId}`; - const fetching = fetch(url, { + const fetching = await fetch(url, { body: JSON.stringify({ api_key: process.env.API_KEY_SDP }), method: "DELETE", }).then(async (r) => { diff --git a/formulaire/pages/api/enfants/[id].tsx b/formulaire/pages/api/enfants/[id].tsx index 0ed40eb17..126281072 100644 --- a/formulaire/pages/api/enfants/[id].tsx +++ b/formulaire/pages/api/enfants/[id].tsx @@ -31,7 +31,7 @@ const remove: NextApiHandler = async (req, res) => { const url = `${process.env.API_URL_INSTRUCTEUR}/inc/enfant/${enfantId}`; - const fetching = fetch(url, { + const fetching = await fetch(url, { body: JSON.stringify({ api_key: process.env.API_KEY_SDP }), method: "DELETE", }).then(async (r) => {