Skip to content

Commit

Permalink
Merge pull request #29 from MengChiehLiu/develop
Browse files Browse the repository at this point in the history
Version 1.0.18
  • Loading branch information
MengChiehLiu authored Aug 24, 2023
2 parents 2aa6a88 + c0c8e7b commit 53cf8f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/server/controllers/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ async function routerDelete(req, res){
await deleteAnEntry(user_id, entry_id)
return res.json({data: {entry: {id: entry_id}}});
}catch(err){
if (err.message === 'Duplicate subjects is not allowed.') return res.status(422).json({error: err.message});
if (err.name === 'CustomError') return res.status(400).json({error: err.message});
console.error(err);
return res.status(500).json({error: 'Internal Server Error'});
Expand Down Expand Up @@ -67,6 +66,7 @@ async function routerPost(req, res){
return res.json({data: {entry: {id: entry_id}}});

}catch(err){
if (err.message === 'Duplicate subjects is not allowed.') return res.status(422).json({error: err.message});
if (err.name === 'CustomError') return res.status(400).json({error: err.message});
console.error(err);
return res.status(500).json({error: 'Internal Server Error'});
Expand Down

0 comments on commit 53cf8f6

Please sign in to comment.