#13 Show error alert on invalid response
This commit is contained in:
11
frontend/src/utils.ts
Normal file
11
frontend/src/utils.ts
Normal 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 };
|
||||
Reference in New Issue
Block a user