Skip to content

Commit

Permalink
Return if error to avoid setting the headers twice (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
atxr authored Dec 21, 2022
1 parent 3c6d3f7 commit 37de8c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions backend/controllers/articleController.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const getByAuthor = async (req, res) => {
const author = req.params.author ?? req.user?.usermame
if (!author) {
res.status(404).json({error: "You must login or provide an author" });
return
}

try {
Expand Down

0 comments on commit 37de8c4

Please sign in to comment.