diff --git a/v1/README.md b/v1/README.md index b5c2667..a9a843a 100644 --- a/v1/README.md +++ b/v1/README.md @@ -294,6 +294,8 @@ Returns a company object - city - state - truck_type + - zipcode + - type (unloading, loading, both) - `POST /new` : Creates a new element. - `PATCH /:id` : Updates data from specific element. - `DELETE /:id` : Delete element from company. Returns the element data. @@ -409,6 +411,9 @@ This endpoint is part of /loads endpoint - phone, city - state - truck_type + - is_accepted + - is_withdrawn + - is_completed - `POST /new` : Creates a new element. - `PATCH /:id` : Updates data from specific element. - `DELETE /:id` : Delete element from company. Returns the element data. diff --git a/v1/src/apps/private/branches/services.js b/v1/src/apps/private/branches/services.js index 1f9d177..c55581c 100644 --- a/v1/src/apps/private/branches/services.js +++ b/v1/src/apps/private/branches/services.js @@ -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;