feat: Adding alert_list filter to loads/branches
This commit is contained in:
@@ -10,7 +10,17 @@ const generic = new GenericHandler( Model, null, populate_list );
|
||||
|
||||
function getAndFilterList( query ){
|
||||
const filter_list = [];
|
||||
const { categories, branch_name, phone, city, state, truck_type, type, zipcode } = query;
|
||||
const {
|
||||
categories,
|
||||
branch_name,
|
||||
phone,
|
||||
city,
|
||||
state,
|
||||
truck_type,
|
||||
type,
|
||||
zipcode,
|
||||
alert_list,
|
||||
} = query;
|
||||
|
||||
if( categories ) { filter_list.push({ categories }); }
|
||||
if( branch_name ) { filter_list.push({ branch_name }); }
|
||||
@@ -20,6 +30,7 @@ function getAndFilterList( query ){
|
||||
if( truck_type ) { filter_list.push({ truck_type }); }
|
||||
if( type ) { filter_list.push({ type }); }
|
||||
if( zipcode ) { filter_list.push({ zipcode }); }
|
||||
if( alert_list ) { filter_list.push({ alert_list }); }
|
||||
|
||||
if( filter_list.length == 0 ){
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user