Skip to content

Commit

Permalink
Return 404 from GET endpoint if user doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Mar 14, 2024
1 parent a156a16 commit 4ddebfe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/stories/solar-eclipse-2024/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ router.get("/data", async (_req, res) => {
router.get("/data/:uuid", async (req, res) => {
const uuid = req.params.uuid as string;
const response = await getSolarEclipse2024Data(uuid);
if (response === null) {
res.status(404).json({ error: "Specified user data does not exist" });
return;
}
res.json({ response });
});

Expand Down

0 comments on commit 4ddebfe

Please sign in to comment.