Fix populated user data for get awardings endpoint (CC-14)

pull/33/head
HardiReady 2018-04-11 20:08:09 +02:00
parent 3256cfd57d
commit 910df3d267
2 changed files with 3 additions and 2 deletions

View File

@ -15,8 +15,9 @@ Awarding associating a decoration to a user
# AwardingPopulated (Awarding)
Awarding with populated decoration and proposer
Awarding with populated decoration, proposer and army-user
## Properties
+ proposer (Proposer, required) - app user who requested this awarding
+ decorationId (Decoration, required) - populated decoration object that is given with the awarding
+ userId (User, required) - populated user who gets this awarding

View File

@ -33,7 +33,7 @@ awarding.route('/')
filter.confirmed = 0;
}
AwardingModel.find(filter, {}, {sort: {date: 'desc'}})
.populate('decorationId').populate('proposer', resultSet)
.populate('decorationId').populate('proposer', resultSet).populate('userId')
.exec((err, items) => {
if (err) {
err.status = codes.servererror;