Merge pull request #2815 from overleaf/jpa-cmg-project-clone-set-owner

Fix cloning a project putting a question mark next to it

GitOrigin-RevId: beb01e3c4496912beb0478017f14ed889a9a09de
This commit is contained in:
Jessica Lawshe 2020-05-12 09:46:29 -05:00 committed by Copybot
parent 30a2997b43
commit 295264697e
2 changed files with 8 additions and 4 deletions

View file

@ -1,3 +1,7 @@
/* eslint-disable
camelcase
*/
const Path = require('path')
const fs = require('fs')
const crypto = require('crypto')
@ -250,6 +254,7 @@ const ProjectController = {
return res.send({ redir: '/register' })
}
const currentUser = AuthenticationController.getSessionUser(req)
const { first_name, last_name, email } = currentUser
ProjectDuplicator.duplicate(
currentUser,
projectId,
@ -265,7 +270,8 @@ const ProjectController = {
res.send({
name: project.name,
project_id: project._id,
owner_ref: project.owner_ref
owner_ref: project.owner_ref,
owner: { first_name, last_name, email, _id: currentUser._id }
})
}
)

View file

@ -536,9 +536,7 @@ define(['../../base', './services/project-list'], function(App) {
name: data.name,
id: data.project_id,
accessLevel: 'owner',
owner: {
_id: data.owner_ref
}
owner: data.owner
// TODO: Check access level if correct after adding it in
// to the rest of the app
})