Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
added good response.ok placement and status code for 404
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerwoud committed May 23, 2024
1 parent dafdbef commit c36f3d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions frontend/src/loaders/submission-overview-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ export default async function loadSubmissionOverview({

const projectId = params.projectId;
const projectResponse = await authenticatedFetch(
`${APIURL}/projects/${projectId}`
`${APIURL}/projects/${projectId}`

Check failure on line 33 in frontend/src/loaders/submission-overview-loader.ts

View workflow job for this annotation

GitHub Actions / Frontend-tests

Expected indentation of 4 spaces but found 6
);

if(projectResponse.status != 200) {
throw new Response("Not authenticated", {status: 403});
if (!projectResponse.ok) {
if (projectResponse.status == 403) {
throw new Response("Not authenticated", {status: 403});
} else if (projectResponse.status == 404) {
throw new Response("Not found", {status: 404});
}
}

const projectData = (await projectResponse.json())["data"];
Expand Down

0 comments on commit c36f3d7

Please sign in to comment.