fix(v1:proposals): Adding shipper/carrier as query

This commit is contained in:
Josepablo C
2024-08-16 19:24:12 -06:00
parent 1f90a9e8b9
commit b7f1404bd4

View File

@@ -20,8 +20,20 @@ const generic = new GenericHandler( Model, null, populate_list );
function getAndFilterList( query ){ function getAndFilterList( query ){
const filter_list = []; const filter_list = [];
const { load, categories, branch_name, phone, city, state, truck_type } = query; const {
shipper,
carrier,
load,
categories,
branch_name,
phone,
city,
state,
truck_type
} = query;
if( shipper ) { filter_list.push({ shipper }); }
if( carrier ) { filter_list.push({ carrier }); }
if( load ) { filter_list.push({ load }); } if( load ) { filter_list.push({ load }); }
if( categories ) { filter_list.push({ categories }); } if( categories ) { filter_list.push({ categories }); }
if( branch_name ) { filter_list.push({ branch_name }); } if( branch_name ) { filter_list.push({ branch_name }); }