From 8a82c69419dc358fbaeab322c32d18ee84656feb Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 5 Sep 2022 21:08:53 -0700 Subject: missing imports and fastify err responses --- routes/swaps.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'routes/swaps.js') diff --git a/routes/swaps.js b/routes/swaps.js index 9f7cfcbf..b37708d6 100644 --- a/routes/swaps.js +++ b/routes/swaps.js @@ -340,7 +340,7 @@ app.delete( const { user } = req; await cancel(user, id); - res.end(); + res.send({}); }) ); @@ -348,14 +348,14 @@ app.post( "/orders", auth, async (req, res) => { - return res.status(500).send("Trading temporarily disabled"); + return res.code(500).send("Trading temporarily disabled"); const { user } = req; try { await swap(user, req.body); - res.end(); + res.send({}); } catch (e) { err(req.user.username, e.message); - res.status(500).send(e.message); + res.code(500).send(e.message); } }) ); @@ -393,7 +393,7 @@ app.get( }) ); } catch (e) { - res.status(500).send(e.message); + res.code(500).send(e.message); } }) ); -- cgit v1.2.3