From aeb0f1e6d8d9f5d8808128f4049768bea57ca164 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 21 Apr 2023 21:15:00 +0300 Subject: [PATCH] Fix Exception in callback of async function: TypeError: this._now is not a function. Thanks to xet7 ! --- models/attachments.js | 1 + 1 file changed, 1 insertion(+) diff --git a/models/attachments.js b/models/attachments.js index 4f543f84e..be52b68b7 100644 --- a/models/attachments.js +++ b/models/attachments.js @@ -95,6 +95,7 @@ Attachments = new FilesCollection({ fileObj.versions[versionName].storage = STORAGE_NAME_FILESYSTEM; }); + this._now = new Date(); Attachments.update({ _id: fileObj._id }, { $set: { "versions" : fileObj.versions } }); Attachments.update({ _id: fileObj.uploadedAtOstrio }, { $set: { "uploadedAtOstrio" : this._now() } });