From 3e413b3f5d793e887b88eaecc12b66faacfc1a43 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Sun, 24 Mar 2019 16:06:17 +0000 Subject: eslint fix --- server/api/configloader.js | 12 ++++++------ server/api/events.js | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'server/api') diff --git a/server/api/configloader.js b/server/api/configloader.js index 0ede64f..63c0d84 100644 --- a/server/api/configloader.js +++ b/server/api/configloader.js @@ -132,8 +132,8 @@ noAuthRouter.get('/getconfig/:configId', (req, res) => { }) }) -async function fetchParentConfigs(groupIds, blacklist) { - if (groupIds.length === 0) return {'ids': [], 'type': ''} +async function fetchParentConfigs (groupIds, blacklist) { + if (groupIds.length === 0) return { 'ids': [], 'type': '' } var importantEvents = [] var events = [] @@ -159,7 +159,7 @@ async function fetchParentConfigs(groupIds, blacklist) { importantEvents = importantEvents.map(e => e.config) importantEvents = importantEvents.filter(c => c !== null) importantEvents = importantEvents.filter(function (elem, pos, arr) { return arr.indexOf(elem) === pos }) - if (importantEvents.length > 0) return {'ids': importantEvents, 'type': 'important'} + if (importantEvents.length > 0) return { 'ids': importantEvents, 'type': 'important' } var response = await fetchParentConfigs(parentIds, newBlacklist) @@ -169,17 +169,17 @@ async function fetchParentConfigs(groupIds, blacklist) { events = events.map(e => e.config) events = events.filter(c => c !== null) events = events.filter(function (elem, pos, arr) { return arr.indexOf(elem) === pos }) - if (events.length > 0) return {'ids': events, 'type': 'event'} + if (events.length > 0) return { 'ids': events, 'type': 'event' } if (response.type === 'event') return response configs = configs.filter(function (elem, pos, arr) { return arr.indexOf(elem) === pos }) configs = configs.filter(c => c !== null) - if (configs.length > 0) return {'ids': configs, 'type': 'config'} + if (configs.length > 0) return { 'ids': configs, 'type': 'config' } if (response.type === 'config') return response - return {'ids': [], 'type': ''} + return { 'ids': [], 'type': '' } } // create the config script from database diff --git a/server/api/events.js b/server/api/events.js index 96bf15e..585f140 100644 --- a/server/api/events.js +++ b/server/api/events.js @@ -35,8 +35,7 @@ router.postAsync('/blacklist', async (req, res) => { if (req.body.groups) { var blacklist = await groupUtil.getAllChildren(req.body.groups) res.send(blacklist) - } - else res.status(404).end() + } else res.status(404).end() }) // Create, Update or Delete POST -- cgit v1.2.3-55-g7522