From 0504bd57e27ab1f8b01a15c43e05104b7cc8b1bd Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Tue, 29 Mar 2022 17:12:44 -0700 Subject: [PATCH] server: fix post 500 errors --- server/src/routes/posts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/routes/posts.ts b/server/src/routes/posts.ts index 8c324c8e..c55f97d8 100644 --- a/server/src/routes/posts.ts +++ b/server/src/routes/posts.ts @@ -98,7 +98,7 @@ posts.post( res.json(newPost) } catch (e) { - next(e) + res.status(400).json(e) } } ) @@ -274,7 +274,7 @@ posts.get( res.json(post) } } catch (e) { - next(e) + res.status(400).json(e) } } )