mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Slightly refactor exports controller body handling
1. Move all body parsing together 2. Remove `firstName && lastName` condition, which duplicates one present in the Handler.
This commit is contained in:
parent
10fcdd6daf
commit
79dc415064
1 changed files with 3 additions and 4 deletions
|
@ -13,11 +13,10 @@ module.exports =
|
||||||
user_id: user_id
|
user_id: user_id
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.body && req.body.firstName && req.body.lastName
|
|
||||||
export_params.first_name = req.body.firstName.trim()
|
|
||||||
export_params.last_name = req.body.lastName.trim()
|
|
||||||
# additional parameters for gallery exports
|
|
||||||
if req.body
|
if req.body
|
||||||
|
export_params.first_name = req.body.firstName.trim() if req.body.firstName
|
||||||
|
export_params.last_name = req.body.lastName.trim() if req.body.lastName
|
||||||
|
# additional parameters for gallery exports
|
||||||
export_params.title = req.body.title.trim() if req.body.title
|
export_params.title = req.body.title.trim() if req.body.title
|
||||||
export_params.description = req.body.description.trim() if req.body.description
|
export_params.description = req.body.description.trim() if req.body.description
|
||||||
export_params.author = req.body.author.trim() if req.body.author
|
export_params.author = req.body.author.trim() if req.body.author
|
||||||
|
|
Loading…
Reference in a new issue