Skip to content

Commit

Permalink
Fix bug in frontend with error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminJohnson2204 committed Jan 4, 2025
1 parent 23e0044 commit df3b590
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/api/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async function assertOk(response: Response): Promise<void> {
export async function get(url: string, headers: Record<string, string> = {}): Promise<Response> {
// GET requests do not have a body
const response = await fetchRequest("GET", API_BASE_URL + url, undefined, headers);
void assertOk(response);
await assertOk(response);
return response;
}

Expand All @@ -107,7 +107,7 @@ export async function post(
headers: Record<string, string> = {},
): Promise<Response> {
const response = await fetchRequest("POST", API_BASE_URL + url, body, headers);
void assertOk(response);
await assertOk(response);
return response;
}

Expand All @@ -125,7 +125,7 @@ export async function put(
headers: Record<string, string> = {},
): Promise<Response> {
const response = await fetchRequest("PUT", API_BASE_URL + url, body, headers);
void assertOk(response);
await assertOk(response);
return response;
}

Expand Down

0 comments on commit df3b590

Please sign in to comment.