From fb85c0a804b976e65a2e4de59a84c2adecb702fe Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 17 Oct 2023 17:57:59 -0400 Subject: [PATCH 1/2] Add API key to /foia_wizard request --- js/util/wizard_api.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/util/wizard_api.js b/js/util/wizard_api.js index 9a903e26..48a7e274 100644 --- a/js/util/wizard_api.js +++ b/js/util/wizard_api.js @@ -2,7 +2,13 @@ import settings from 'settings'; export function fetchWizardInitData() { - return fetch(`${settings.api.requestApiBaseURL}/foia_wizard`) + const options = { + headers: { + 'Content-Type': 'application/json', + 'X-Api-Key': settings.api.apiProxyKey, + }, + }; + return fetch(`${settings.api.requestApiBaseURL}/foia_wizard`, options) .then((r) => r.json()); } From 86a5297f24ac153b8784e52a3a7c0a5a8efecafe Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 17 Oct 2023 18:06:16 -0400 Subject: [PATCH 2/2] No need for Content-Type for a GET request --- js/util/wizard_api.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/util/wizard_api.js b/js/util/wizard_api.js index 48a7e274..aa75c44b 100644 --- a/js/util/wizard_api.js +++ b/js/util/wizard_api.js @@ -4,7 +4,6 @@ import settings from 'settings'; export function fetchWizardInitData() { const options = { headers: { - 'Content-Type': 'application/json', 'X-Api-Key': settings.api.apiProxyKey, }, };