Skip to content

Commit

Permalink
fix: code updated for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Sundroid-ops committed Oct 22, 2023
1 parent 14fe812 commit 8d09508
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions routes/events/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ router.get("/", async (req, res) => {
if (eventDetails) {
return res.status(STATUSCODE.OK).json(eventDetails);
}
return res.status(STATUSCODE.NOT_FOUND).json(STATUSMESSAGE.NOT_FOUND);
return res
.status(STATUSCODE.NOT_FOUND)
.json({ message: STATUSMESSAGE.NOT_FOUND });
}

const allEvents = await Event.find({});
res.status(STATUSCODE.OK).json(allEvents);
} catch (error) {
console.log(error);
res
return res
.status(STATUSCODE.INTERNAL_SERVER_ERROR)
.json(STATUSMESSAGE.INTERNAL_SERVER_ERROR);
.json({ message: STATUSMESSAGE.INTERNAL_SERVER_ERROR });
}
});

Expand Down

0 comments on commit 8d09508

Please sign in to comment.