feat: Adding type/zipcode to branches filter

This commit is contained in:
Josepablo C
2024-09-28 20:08:34 -06:00
parent 4c28c9122b
commit 5b4318fa6e
2 changed files with 8 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ const generic = new GenericHandler( Model, null, populate_list );
function getAndFilterList( query ){
const filter_list = [];
const { categories, branch_name, phone, city, state, truck_type } = query;
const { categories, branch_name, phone, city, state, truck_type, type, zipcode } = query;
if( categories ) { filter_list.push({ categories }); }
if( branch_name ) { filter_list.push({ branch_name }); }
@@ -18,6 +18,8 @@ function getAndFilterList( query ){
if( city ) { filter_list.push({ city }); }
if( state ) { filter_list.push({ state }); }
if( truck_type ) { filter_list.push({ truck_type }); }
if( type ) { filter_list.push({ type }); }
if( zipcode ) { filter_list.push({ zipcode }); }
if( filter_list.length == 0 ){
return null;