From 3b9f2ca7c2fffa230bb0c6d4254a88deb9fbb023 Mon Sep 17 00:00:00 2001 From: Justin Reynolds Date: Thu, 5 Sep 2019 12:29:45 -0500 Subject: Fixes #2596 incorrect date types for created & updated --- models/invitationCodes.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'models/invitationCodes.js') diff --git a/models/invitationCodes.js b/models/invitationCodes.js index 75db5708..abb30f32 100644 --- a/models/invitationCodes.js +++ b/models/invitationCodes.js @@ -18,6 +18,8 @@ InvitationCodes.attachSchema( autoValue() { if (this.isInsert) { return new Date(); + } else if (this.isUpsert) { + return { $setOnInsert: new Date() }; } else { this.unset(); } -- cgit v1.2.3-1-g7c22