From 79dc4150643a20f4dd786fbb04e7696564a4fc13 Mon Sep 17 00:00:00 2001 From: Michael Mazour Date: Fri, 14 Sep 2018 10:14:12 +0100 Subject: [PATCH] Slightly refactor exports controller body handling 1. Move all body parsing together 2. Remove `firstName && lastName` condition, which duplicates one present in the Handler. --- .../app/coffee/Features/Exports/ExportsController.coffee | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/services/web/app/coffee/Features/Exports/ExportsController.coffee b/services/web/app/coffee/Features/Exports/ExportsController.coffee index 2f14fdb183..5e76e9a4b8 100644 --- a/services/web/app/coffee/Features/Exports/ExportsController.coffee +++ b/services/web/app/coffee/Features/Exports/ExportsController.coffee @@ -13,11 +13,10 @@ module.exports = 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 + 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.description = req.body.description.trim() if req.body.description export_params.author = req.body.author.trim() if req.body.author