Browse Source

Use more succint error syntax

sbkwgh 8 years ago
parent
commit
bd84d63a16
1 changed files with 1 additions and 1 deletions
  1. 1 1
      routes/post.js

+ 1 - 1
routes/post.js

@@ -79,7 +79,7 @@ router.put('/:post_id/like', async (req, res) => {
 		res.json({ success: true })
 
 	} catch (e) {
-		if(['invalidParameter', 'cannotLikeOwnPost'].includes(e.name)) {
+		if(e.name in Errors) {
 			res.status(400)
 			res.json({
 				errors: [e]