mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #2965 from overleaf/cmg-ns-no-question-mark-create-project
Specify owner when creating new project GitOrigin-RevId: cf0505767a3eabbbbf7c6a429ee449c5dad14e4c
This commit is contained in:
parent
0da739fdc4
commit
b1b0d54285
2 changed files with 18 additions and 5 deletions
|
@ -278,7 +278,13 @@ const ProjectController = {
|
|||
},
|
||||
|
||||
newProject(req, res, next) {
|
||||
const userId = AuthenticationController.getLoggedInUserId(req)
|
||||
const currentUser = AuthenticationController.getSessionUser(req)
|
||||
const {
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
email,
|
||||
_id: userId
|
||||
} = currentUser
|
||||
const projectName =
|
||||
req.body.projectName != null ? req.body.projectName.trim() : undefined
|
||||
const { template } = req.body
|
||||
|
@ -297,7 +303,16 @@ const ProjectController = {
|
|||
if (err != null) {
|
||||
return next(err)
|
||||
}
|
||||
res.send({ project_id: project._id })
|
||||
res.send({
|
||||
project_id: project._id,
|
||||
owner_ref: project.owner_ref,
|
||||
owner: {
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
email,
|
||||
_id: userId
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
|
|
|
@ -446,9 +446,7 @@ App.controller('ProjectPageController', function(
|
|||
name,
|
||||
_id: data.project_id,
|
||||
accessLevel: 'owner',
|
||||
owner: {
|
||||
_id: window.user_id
|
||||
}
|
||||
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