Browse Source

Changed to toISOString()

Steven Fukase 5 years ago
parent
commit
bb7e9b48b8
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/server/service/page.js

+ 4 - 4
src/server/service/page.js

@@ -105,7 +105,7 @@ class PageService {
       if (updateMetadata) {
         unorderedBulkOp
           .find({ _id: page._id })
-          .update({ $set: { path: newPagePath, lastUpdateUser: user._id, updatedAt: { $dateFromString: { dateString: Date.now() } } } });
+          .update({ $set: { path: newPagePath, lastUpdateUser: user._id, updatedAt: Date.now().toISOString() } });
       }
       else {
         unorderedBulkOp.find({ _id: page._id }).update({ $set: { path: newPagePath } });
@@ -635,9 +635,9 @@ class PageService {
       const toPath = Page.getRevertDeletedPageName(page.path);
 
       if (pathToPageMapping[toPath] != null) {
-      // When the page is deleted, it will always be created with "redirectTo" in the path of the original page.
-      // So, it's ok to delete the page
-      // However, If a page exists that is not "redirectTo", something is wrong. (Data correction is needed).
+        // When the page is deleted, it will always be created with "redirectTo" in the path of the original page.
+        // So, it's ok to delete the page
+        // However, If a page exists that is not "redirectTo", something is wrong. (Data correction is needed).
         if (pathToPageMapping[toPath].redirectTo === page.path) {
           removePageBulkOp.find({ path: toPath }).remove();
         }