This commit is contained in:
lesion 2019-03-22 00:49:47 +01:00
parent 90ae6835a5
commit 50ea3d65b0
2 changed files with 7 additions and 6 deletions

View file

@ -55,7 +55,7 @@ const eventController = {
if (tag) { if (tag) {
res.json(await tag.update(req.body)) res.json(await tag.update(req.body))
} else { } else {
res.send(404) res.sendStatus(404)
} }
}, },
@ -92,9 +92,9 @@ const eventController = {
try { try {
await event.update({ is_visible: false }) await event.update({ is_visible: false })
res.send(200) res.sendStatus(200)
} catch (e) { } catch (e) {
res.send(404) res.sendStatus(404)
} }
}, },
@ -112,6 +112,7 @@ const eventController = {
async addNotification (req, res) { async addNotification (req, res) {
try { try {
const notification = { const notification = {
filters: { is_visible: true },
email: req.body.email, email: req.body.email,
type: 'mail', type: 'mail',
remove_code: crypto.randomBytes(16).toString('hex') 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 } } }) const notification = await Notification.findOne({ where: { remove_code: { [Op.eq]: remove_code } } })
await notification.destroy() await notification.destroy()
} catch (e) { } catch (e) {
return res.status(404).send('Error') return res.sendStatus(404)
} }
res.send('Ok, notification removed') res.sendStatus(200)
}, },
async getAll (req, res) { async getAll (req, res) {

View file

@ -252,7 +252,7 @@ const userController = {
await user.update(req.body) await user.update(req.body)
res.json(user) res.json(user)
} else { } else {
res.send(400) res.sendStatus(400)
} }
}, },