Skip to content

Commit d78aed8

Browse files
author
Will Howard
committed
Corrected request header on submit form.
1 parent f557afa commit d78aed8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/pages/form-submit.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,21 @@ const FormSubmit = ({ history }) => {
2020

2121
const submitForm = async () => {
2222
try {
23-
const response = await Axios.post(URLs.submitForm, {
23+
const body = {
2424
storeType,
2525
storeDetails,
2626
firstName,
2727
lastName,
28-
});
28+
};
29+
const options = {
30+
method: 'POST',
31+
headers: {
32+
'Content-Type': 'application/json',
33+
},
34+
data: JSON.stringify(body),
35+
url: URLs.submitForm,
36+
};
37+
const response = await Axios(options);
2938

3039
console.log('Form submission response: ', response);
3140
} catch (error) {

0 commit comments

Comments
 (0)