Skip to content

Commit

Permalink
Merge pull request #222 from NickPhura/ACRFD-13-4
Browse files Browse the repository at this point in the history
ACRFD-13-4: Set mongoose flag to return updated object.
  • Loading branch information
NickPhura authored Jul 8, 2019
2 parents 380d213 + 4725e94 commit 24db261
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/helpers/ttlsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,10 @@ const updateApplicationMeta = function(acrfdApp, tantalisApp) {
updatedAppObject.statusHistoryEffectiveDate = acrfdApp.statusHistoryEffectiveDate;

const ApplicationModel = mongoose.model('Application');
ApplicationModel.findOneAndUpdate({ _id: acrfdApp._id }, updatedAppObject, function(error, updatedApp) {
ApplicationModel.findOneAndUpdate({ _id: acrfdApp._id }, updatedAppObject, { new: true }, function(
error,
updatedApp
) {
if (error) {
defaultLog.error('updateApplicationMeta:', error);
reject(error);
Expand Down

0 comments on commit 24db261

Please sign in to comment.