From 7381cac0e94afd5df9814d29763790cb9de6f28b Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Thu, 4 Aug 2022 21:59:50 +0700 Subject: [PATCH] chore: indents and comments --- controllers/uploadController.js | 5 ++++- controllers/utilsController.js | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/controllers/uploadController.js b/controllers/uploadController.js index bdb5a37..456a36f 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -217,8 +217,11 @@ self.unholdUploadIdentifiers = res => { } self.assertRetentionPeriod = (user, age) => { - if (!utils.retentions.enabled) return null + if (!utils.retentions.enabled) { + return null + } + // _ is special key for non-registered users (no auth requests) const group = user ? perms.group(user) : '_' if (!group || !utils.retentions.periods[group]) { throw new ClientError('You are not eligible for any file retention periods.', { statusCode: 403 }) diff --git a/controllers/utilsController.js b/controllers/utilsController.js index f8230bf..5f32022 100644 --- a/controllers/utilsController.js +++ b/controllers/utilsController.js @@ -602,7 +602,9 @@ self.unlinkFile = async (filename, predb) => { self.bulkDeleteFromDb = async (field, values, user) => { // Always return an empty array on failure - if (!user || !['id', 'name'].includes(field) || !values.length) return [] + if (!user || !['id', 'name'].includes(field) || !values.length) { + return [] + } // SQLITE_LIMIT_VARIABLE_NUMBER, which defaults to 999 // Read more: https://www.sqlite.org/limits.html