[lint] linting

This commit is contained in:
les
2019-10-28 17:33:20 +01:00
parent bda72f1559
commit e467a28902
56 changed files with 373 additions and 306 deletions

View File

@@ -2,8 +2,8 @@ const crypto = require('crypto')
const moment = require('moment-timezone')
const { Op } = require('sequelize')
const lodash = require('lodash')
const { event: Event, comment: Comment, tag: Tag, place: Place,
user: User, notification: Notification, event_notification: EventNotification } = require('../models')
const { event: Event, comment: Comment, tag: Tag, place: Place,
user: User, notification: Notification } = require('../models')
const Sequelize = require('sequelize')
const exportController = require('./export')
const debug = require('debug')('controller:event')
@@ -142,7 +142,7 @@ const eventController = {
async unconfirm (req, res) {
const id = Number(req.params.event_id)
const event = await Event.findByPk(id)
if (!event) { return sendStatus(404) }
if (!event) { return req.sendStatus(404) }
try {
event.is_visible = false
@@ -219,7 +219,7 @@ const eventController = {
{ start_datetime: { [Op.between]: [start.unix(), end.unix()] } }
]
},
attributes: { exclude: ['createdAt', 'updatedAt', 'placeId' ] },
attributes: { exclude: [ 'createdAt', 'updatedAt', 'placeId' ] },
order: [[Tag, 'weigth', 'DESC']],
include: [
{ model: Comment, required: false, attributes: ['id'] },

View File

@@ -65,7 +65,7 @@ const exportController = {
url: `${req.settings.baseurl}/event/${e.id}`,
alarms: [{
action: 'display',
trigger: {hours: 1, before: true}
trigger: { hours: 1, before: true }
}]
}
})

View File

@@ -200,7 +200,7 @@ const userController = {
},
async current (req, res) {
if (!req.user) return res.status(400).send('Not logged')
if (!req.user) { return res.status(400).send('Not logged') }
const user = await User.findByPk(req.user.id, { include: { model: FedUsers, as: 'followers' } })
res.json(user)
},
@@ -214,7 +214,7 @@ const userController = {
async update (req, res) {
// user to modify
user = await User.findByPk(req.body.id)
const user = await User.findByPk(req.body.id)
if (!user) { return res.status(404).json({ success: false, message: 'User not found!' }) }