|
|
|
@ -4,7 +4,6 @@ var _ = require('lodash');
|
|
|
|
|
var validator = require('validator');
|
|
|
|
|
|
|
|
|
|
var db = require('../database');
|
|
|
|
|
var user = require('../user');
|
|
|
|
|
var posts = require('../posts');
|
|
|
|
|
var topics = require('../topics');
|
|
|
|
|
var utils = require('../../public/src/utils');
|
|
|
|
@ -97,7 +96,7 @@ module.exports = function (User) {
|
|
|
|
|
async function formatBanData(bans) {
|
|
|
|
|
const banData = await db.getObjects(bans);
|
|
|
|
|
const uids = banData.map(banData => banData.fromUid);
|
|
|
|
|
const usersData = await user.getUsersFields(uids, ['uid', 'username', 'userslug', 'picture']);
|
|
|
|
|
const usersData = await User.getUsersFields(uids, ['uid', 'username', 'userslug', 'picture']);
|
|
|
|
|
return banData.map(function (banObj, index) {
|
|
|
|
|
banObj.user = usersData[index];
|
|
|
|
|
banObj.until = parseInt(banObj.expire, 10);
|
|
|
|
|