From d6e6945086a2f4abc741d13ec3f7b2d8622675f2 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 2 Jun 2025 16:25:31 +0200 Subject: Fix alarm bug, fix error middleware --- src/api/routes/alarmRoutes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/api/routes/alarmRoutes.js') diff --git a/src/api/routes/alarmRoutes.js b/src/api/routes/alarmRoutes.js index 07a97c2..939ca97 100644 --- a/src/api/routes/alarmRoutes.js +++ b/src/api/routes/alarmRoutes.js @@ -79,7 +79,8 @@ export const alarmRoute = { middlewares: [requireUser], description: 'Raise an alarm', async method(req, res) { - req.user.alarm = AlarmDto.create(req.body); + console.log(req.body); + req.user.alarm = await AlarmDto.create(req.body); await req.user.save(); res.status(204).send(); } -- cgit 1.5.1