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 Path = require('path')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
|
@ -250,6 +254,7 @@ const ProjectController = {
|
||||||
return res.send({ redir: '/register' })
|
return res.send({ redir: '/register' })
|
||||||
}
|
}
|
||||||
const currentUser = AuthenticationController.getSessionUser(req)
|
const currentUser = AuthenticationController.getSessionUser(req)
|
||||||
|
const { first_name, last_name, email } = currentUser
|
||||||
ProjectDuplicator.duplicate(
|
ProjectDuplicator.duplicate(
|
||||||
currentUser,
|
currentUser,
|
||||||
projectId,
|
projectId,
|
||||||
|
@ -265,7 +270,8 @@ const ProjectController = {
|
||||||
res.send({
|
res.send({
|
||||||
name: project.name,
|
name: project.name,
|
||||||
project_id: project._id,
|
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,
|
name: data.name,
|
||||||
id: data.project_id,
|
id: data.project_id,
|
||||||
accessLevel: 'owner',
|
accessLevel: 'owner',
|
||||||
owner: {
|
owner: data.owner
|
||||||
_id: data.owner_ref
|
|
||||||
}
|
|
||||||
// TODO: Check access level if correct after adding it in
|
// TODO: Check access level if correct after adding it in
|
||||||
// to the rest of the app
|
// to the rest of the app
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue