mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-08 16:50:44 +02: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:
committed by
Copybot
parent
0da739fdc4
commit
b1b0d54285
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user