From 4725e94149451729349b1b004bccb07e41bb515c Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 8 Jul 2019 13:42:20 -0700 Subject: [PATCH] ACRFD-13-4: Set mongoose flag to return updated object. --- api/helpers/ttlsUtils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/helpers/ttlsUtils.js b/api/helpers/ttlsUtils.js index 66466cb..291ad51 100644 --- a/api/helpers/ttlsUtils.js +++ b/api/helpers/ttlsUtils.js @@ -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);