diff --git a/server/data/autohouse.js b/server/data/autohouse.js index 5688f7bc7..417e4caaa 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -39,7 +39,7 @@ exports.default = async (req, res) => { const { bodyshops } = await client.request(queries.GET_AUTOHOUSE_SHOPS); const specificShopIds = req.body.bodyshopIds; // ['uuid] - const start = req.body.start; //YYYY-MM-DD + const { start, end } = req.body; //YYYY-MM-DD const allxmlsToUpload = []; const allErrors = []; try { @@ -58,6 +58,7 @@ exports.default = async (req, res) => { start: start ? moment(start).startOf("day") : moment().subtract(3, "days").startOf("day"), + ...(end && { end: moment(end).startOf("day") }), } );