feat(loads): Adding shipper_warehouse as filter to the calendars endpoint
This commit is contained in:
@@ -111,10 +111,12 @@ async function findCalendarLoads( userId, companyId, query ){
|
|||||||
"createdAt",
|
"createdAt",
|
||||||
"shipment_code",
|
"shipment_code",
|
||||||
"est_loading_date",
|
"est_loading_date",
|
||||||
"est_unloading_date"
|
"est_unloading_date",
|
||||||
|
"shipper_warehouse"
|
||||||
];
|
];
|
||||||
const { date, load_status , $sort } = query;
|
const { date, load_status , $sort } = query;
|
||||||
const { global } = query;
|
const { global } = query;
|
||||||
|
const { shipper_warehouse } = query;
|
||||||
|
|
||||||
if( ! date ){
|
if( ! date ){
|
||||||
throw "Date field is required";
|
throw "Date field is required";
|
||||||
@@ -152,6 +154,10 @@ async function findCalendarLoads( userId, companyId, query ){
|
|||||||
andFilterList.push( { load_status } )
|
andFilterList.push( { load_status } )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( shipper_warehouse ){
|
||||||
|
andFilterList.push( { shipper_warehouse } )
|
||||||
|
}
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
$and : andFilterList,
|
$and : andFilterList,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user