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",
|
||||
"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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user