chore: indents and comments

This commit is contained in:
Bobby Wibowo 2022-08-04 21:59:50 +07:00
parent d7d6a29123
commit 7381cac0e9
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
2 changed files with 7 additions and 2 deletions

View File

@ -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 })

View File

@ -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