Autohouse - Export 1
This commit is contained in:
@@ -37,12 +37,15 @@ exports.default = async (req, res) => {
|
|||||||
//Query for the List of Bodyshop Clients.
|
//Query for the List of Bodyshop Clients.
|
||||||
logger.log("autohouse-start", "DEBUG", "api", null, null);
|
logger.log("autohouse-start", "DEBUG", "api", null, null);
|
||||||
const { bodyshops } = await client.request(queries.GET_AUTOHOUSE_SHOPS);
|
const { bodyshops } = await client.request(queries.GET_AUTOHOUSE_SHOPS);
|
||||||
639;
|
|
||||||
|
|
||||||
|
const specificShopIds = req.body.bodyshopIds; // ['uuid]
|
||||||
|
const start = req.body.start; //YYYY-MM-DD
|
||||||
const allxmlsToUpload = [];
|
const allxmlsToUpload = [];
|
||||||
const allErrors = [];
|
const allErrors = [];
|
||||||
try {
|
try {
|
||||||
for (const bodyshop of bodyshops) {
|
for (const bodyshop of specificShopIds
|
||||||
|
? bodyshops.filter((b) => specificShopIds.includes(b.id))
|
||||||
|
: bodyshops) {
|
||||||
logger.log("autohouse-start-shop-extract", "DEBUG", "api", bodyshop.id, {
|
logger.log("autohouse-start-shop-extract", "DEBUG", "api", bodyshop.id, {
|
||||||
shopname: bodyshop.shopname,
|
shopname: bodyshop.shopname,
|
||||||
});
|
});
|
||||||
@@ -52,7 +55,9 @@ exports.default = async (req, res) => {
|
|||||||
queries.AUTOHOUSE_QUERY,
|
queries.AUTOHOUSE_QUERY,
|
||||||
{
|
{
|
||||||
bodyshopid: bodyshop.id,
|
bodyshopid: bodyshop.id,
|
||||||
start: moment().subtract(3, "days").startOf("day"),
|
start: start
|
||||||
|
? moment(start).startOf("day")
|
||||||
|
: moment().subtract(3, "days").startOf("day"),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user