#13 Show error alert on invalid response

This commit is contained in:
2023-03-19 02:17:36 -04:00
parent 6e7e3e66f5
commit abb1769c48
2 changed files with 33 additions and 12 deletions

11
frontend/src/utils.ts Normal file
View File

@@ -0,0 +1,11 @@
const makeRequest = ({ url, method, body }): Promise<Response> => {
return fetch(url, {
method: method,
credentials: "include",
body: JSON.stringify(body),
headers: { "content-type": "application/json" },
mode: "cors",
});
};
export { makeRequest };