Browse Source

Merge pull request #2522 from overleaf/sk-set-last-updated-by-on-creation

Set lastUpdatedBy when a project is created

GitOrigin-RevId: ed3a7379b538cc40932f61fc17a926e00eb2abdb
Simon Detheridge 6 years ago
parent
commit
7ce322758b

+ 1 - 1
services/web/app/src/Features/Project/ProjectCreationHandler.js

@@ -96,7 +96,7 @@ const ProjectCreationHandler = {
     }
     const rootFolder = new Folder({ name: 'rootFolder' })
 
-    attributes.owner_ref = new ObjectId(owner_id)
+    attributes.lastUpdatedBy = attributes.owner_ref = new ObjectId(owner_id)
     attributes.name = projectName
     const project = new Project(attributes)
 

+ 1 - 0
services/web/test/unit/src/Project/ProjectCreationHandlerTests.js

@@ -110,6 +110,7 @@ describe('ProjectCreationHandler', function() {
             }
             project.name.should.equal(projectName)
             expect(project.owner_ref + '').to.equal(ownerId)
+            expect(project.lastUpdatedBy + '').to.equal(ownerId)
             done()
           }
         )