From 910df3d2677faf5e6cc85b43e79f6f8847b3df15 Mon Sep 17 00:00:00 2001 From: HardiReady Date: Wed, 11 Apr 2018 20:08:09 +0200 Subject: [PATCH] Fix populated user data for get awardings endpoint (CC-14) --- api/apib/data_structures/_awarding.apib | 3 ++- api/routes/awardings.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/apib/data_structures/_awarding.apib b/api/apib/data_structures/_awarding.apib index bf2acfe..b66dc10 100644 --- a/api/apib/data_structures/_awarding.apib +++ b/api/apib/data_structures/_awarding.apib @@ -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 diff --git a/api/routes/awardings.js b/api/routes/awardings.js index 2402632..e256bf9 100644 --- a/api/routes/awardings.js +++ b/api/routes/awardings.js @@ -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;