mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
simplified flags.get a tad
This commit is contained in:
@@ -30,7 +30,7 @@ Flags.get = function (flagId, callback) {
|
|||||||
function (data, next) {
|
function (data, next) {
|
||||||
// Second stage
|
// Second stage
|
||||||
async.parallel({
|
async.parallel({
|
||||||
userObj: async.apply(user.getUserFields, data.base.uid, ['username', 'picture']),
|
userObj: async.apply(user.getUserFields, data.base.uid, ['username', 'userslug', 'picture']),
|
||||||
targetObj: async.apply(Flags.getTarget, data.base.type, data.base.targetId, data.base.uid)
|
targetObj: async.apply(Flags.getTarget, data.base.type, data.base.targetId, data.base.uid)
|
||||||
}, function (err, payload) {
|
}, function (err, payload) {
|
||||||
// Final object return construction
|
// Final object return construction
|
||||||
@@ -40,12 +40,7 @@ Flags.get = function (flagId, callback) {
|
|||||||
target: payload.targetObj,
|
target: payload.targetObj,
|
||||||
history: data.history,
|
history: data.history,
|
||||||
notes: data.notes,
|
notes: data.notes,
|
||||||
reporter: {
|
reporter: payload.userObj
|
||||||
username: payload.userObj.username,
|
|
||||||
picture: payload.userObj.picture,
|
|
||||||
'icon:bgColor': payload.userObj['icon:bgColor'],
|
|
||||||
'icon:text': payload.userObj['icon:text']
|
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user