mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
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:
parent
30a2997b43
commit
295264697e
2 changed files with 8 additions and 4 deletions
|
@ -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 }
|
||||
})
|
||||
}
|
||||
)
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue