Skip to content

Commit

Permalink
remove axios
Browse files Browse the repository at this point in the history
  • Loading branch information
unfiltered-syrup committed Dec 7, 2023
1 parent bf32cc4 commit e5b3e2f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
18 changes: 14 additions & 4 deletions front-end/src/components/settings/FeedbackSupportPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@ const FeedbackSupportPage = () => {
category: category,
feedback: feedback,
};
const response = await axios.post(
`${process.env.REACT_APP_BACKEND}/feedback/newfeedback`,
requestData
);
const response = await fetch(`${process.env.REACT_APP_BACKEND}/feedback/newfeedback`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(requestData)
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
})
.catch((error) => {
console.error('Error:', error);
});
console.log(`Server response: ${JSON.stringify(response.data, null, 0)}`);
setErrorMessage("");
setResponse(response.data);
Expand Down
12 changes: 11 additions & 1 deletion front-end/src/utils/stops.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ export async function queryStops() {
const url = `${localStorage.serviceEndpointHome}/mapGetData.php?${urlParams.toString()}`;

try {
const response = await axios.post(url, formData);
const response = await fetch(url, {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
const data = response.data;
if (!data) {
throw new Error('empty response');
Expand Down

0 comments on commit e5b3e2f

Please sign in to comment.