From 50ea3d65b0d256e82b2359def382f66932f46b94 Mon Sep 17 00:00:00 2001 From: lesion Date: Fri, 22 Mar 2019 00:49:47 +0100 Subject: [PATCH] minor --- app/controller/event.js | 11 ++++++----- app/controller/user.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controller/event.js b/app/controller/event.js index 84f9c578..0db8dbe9 100644 --- a/app/controller/event.js +++ b/app/controller/event.js @@ -55,7 +55,7 @@ const eventController = { if (tag) { res.json(await tag.update(req.body)) } else { - res.send(404) + res.sendStatus(404) } }, @@ -92,9 +92,9 @@ const eventController = { try { await event.update({ is_visible: false }) - res.send(200) + res.sendStatus(200) } catch (e) { - res.send(404) + res.sendStatus(404) } }, @@ -112,6 +112,7 @@ const eventController = { async addNotification (req, res) { try { const notification = { + filters: { is_visible: true }, email: req.body.email, type: 'mail', remove_code: crypto.randomBytes(16).toString('hex') @@ -129,9 +130,9 @@ const eventController = { const notification = await Notification.findOne({ where: { remove_code: { [Op.eq]: remove_code } } }) await notification.destroy() } catch (e) { - return res.status(404).send('Error') + return res.sendStatus(404) } - res.send('Ok, notification removed') + res.sendStatus(200) }, async getAll (req, res) { diff --git a/app/controller/user.js b/app/controller/user.js index 466dc9dd..923e2414 100644 --- a/app/controller/user.js +++ b/app/controller/user.js @@ -252,7 +252,7 @@ const userController = { await user.update(req.body) res.json(user) } else { - res.send(400) + res.sendStatus(400) } },