#32 Remove dummy data. Modified makeRequest so it doesn't send body on GET

This commit was merged in pull request #37.
This commit is contained in:
2023-04-06 23:03:57 -04:00
parent 15d336ca53
commit 1dfa9c1421
2 changed files with 15 additions and 42 deletions

View File

@@ -1,11 +1,14 @@
const makeRequest = ({ url, method, body = {} }): Promise<Response> => {
return fetch(url, {
const makeRequest = ({ url, method, body = null }): Promise<Response> => {
const req: RequestInit = {
method: method,
credentials: "include",
body: JSON.stringify(body),
headers: { "content-type": "application/json" },
mode: "cors",
});
};
if (body) {
req["body"] = JSON.stringify(body);
}
return fetch(url, req);
};
const sendLoginRequest = async (