mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
chore: eslint prefer-destructuring
This commit is contained in:
committed by
Julian Lam
parent
8d1462ffd8
commit
23f212a4c0
@@ -15,7 +15,7 @@ exports.buildReqObject = (req, payload) => {
|
||||
req = req || {};
|
||||
const headers = req.headers || {};
|
||||
const encrypted = req.connection ? !!req.connection.encrypted : false;
|
||||
let host = headers.host;
|
||||
let { host } = headers;
|
||||
const referer = headers.referer || '';
|
||||
|
||||
if (!host) {
|
||||
|
||||
@@ -8,7 +8,7 @@ const privileges = require('../privileges');
|
||||
|
||||
const apiHelpers = require('./helpers');
|
||||
|
||||
const doTopicAction = apiHelpers.doTopicAction;
|
||||
const { doTopicAction } = apiHelpers;
|
||||
|
||||
const websockets = require('../socket.io');
|
||||
const socketHelpers = require('../socket.io/helpers');
|
||||
|
||||
@@ -229,7 +229,7 @@ usersAPI.unban = async function (caller, data) {
|
||||
};
|
||||
|
||||
async function isPrivilegedOrSelfAndPasswordMatch(caller, data) {
|
||||
const uid = caller.uid;
|
||||
const { uid } = caller;
|
||||
const isSelf = parseInt(uid, 10) === parseInt(data.uid, 10);
|
||||
|
||||
const [isAdmin, isTargetAdmin, isGlobalMod] = await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user