From 7e273bc0d8524e080fcc5b677d98bca24ac4aaa5 Mon Sep 17 00:00:00 2001 From: Josepablo C Date: Sun, 2 Mar 2025 20:44:05 -0600 Subject: [PATCH] feat(loads): Adding shipper_warehouse as filter to the calendars endpoint --- v1/src/apps/private/loads/services.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/v1/src/apps/private/loads/services.js b/v1/src/apps/private/loads/services.js index 7d790e8..50d316a 100644 --- a/v1/src/apps/private/loads/services.js +++ b/v1/src/apps/private/loads/services.js @@ -111,10 +111,12 @@ async function findCalendarLoads( userId, companyId, query ){ "createdAt", "shipment_code", "est_loading_date", - "est_unloading_date" + "est_unloading_date", + "shipper_warehouse" ]; const { date, load_status , $sort } = query; const { global } = query; + const { shipper_warehouse } = query; if( ! date ){ throw "Date field is required"; @@ -152,6 +154,10 @@ async function findCalendarLoads( userId, companyId, query ){ andFilterList.push( { load_status } ) } + if( shipper_warehouse ){ + andFilterList.push( { shipper_warehouse } ) + } + const filter = { $and : andFilterList, };