feat/fix: Adding missing fields to branches/proposals
This commit is contained in:
@@ -29,9 +29,15 @@ function getAndFilterList( query ){
|
||||
phone,
|
||||
city,
|
||||
state,
|
||||
truck_type
|
||||
truck_type,
|
||||
is_accepted,
|
||||
is_withdrawn,
|
||||
is_completed,
|
||||
} = query;
|
||||
|
||||
if( is_completed ) { filter_list.push({ is_completed }); }
|
||||
if( is_withdrawn ) { filter_list.push({ is_withdrawn }); }
|
||||
if( is_accepted ) { filter_list.push({ is_accepted }); }
|
||||
if( shipper ) { filter_list.push({ shipper }); }
|
||||
if( carrier ) { filter_list.push({ carrier }); }
|
||||
if( load ) { filter_list.push({ load }); }
|
||||
|
||||
@@ -5,12 +5,18 @@ const { GenericHandler } = require( `${ROOT_PATH}/${HANDLERS_PATH}/Generic.handl
|
||||
const Model = require( `${ROOT_PATH}/${MODELS_PATH}/loads.model.js` );
|
||||
const categoriesModel = require( `${ROOT_PATH}/${MODELS_PATH}/product-categories.model.js` );
|
||||
|
||||
const populate_list = ['categories'];
|
||||
const populate_list = ['categories','vehicle'];
|
||||
// last_location_lat
|
||||
// last_location_lng
|
||||
// last_location_geo
|
||||
// last_location_time
|
||||
// background_tracking
|
||||
const generic = new GenericHandler( Model, null, populate_list );
|
||||
|
||||
const getList = async(req, res) => {
|
||||
const filter = { status : "Published" };
|
||||
const select = [
|
||||
"shipment_code",
|
||||
"categories",
|
||||
"truck_type",
|
||||
"published_date",
|
||||
@@ -19,10 +25,13 @@ const getList = async(req, res) => {
|
||||
"weight",
|
||||
"est_loading_date",
|
||||
"est_unloading_date",
|
||||
"origin.city",
|
||||
"origin.state",
|
||||
"destination.city",
|
||||
"destination.state",
|
||||
"origin",
|
||||
"destination",
|
||||
"vehicle.last_location_lat",
|
||||
"vehicle.last_location_lng",
|
||||
"vehicle.last_location_geo",
|
||||
"vehicle.last_location_time",
|
||||
"vehicle.background_tracking"
|
||||
];
|
||||
const { page , elements } = getPagination( req.query );
|
||||
const retVal = await generic.getList(page , elements, filter, select );
|
||||
|
||||
Reference in New Issue
Block a user