fix(loads): Adding support to filter with carrierId

This commit is contained in:
Josepablo C
2024-08-15 14:19:29 -06:00
parent cb2f3f5bfd
commit 07820bbb1d
2 changed files with 3 additions and 3 deletions

View File

@@ -359,7 +359,7 @@ This endpoint is part of /loads endpoint
- `GET /find` : Find a list of elements with any of the following fields: - `GET /find` : Find a list of elements with any of the following fields:
- companyId - companyId
- carrier - carrierId
- vehicle - vehicle
- driver - driver
- status - status

View File

@@ -14,7 +14,7 @@ function getAndFilterList( query ){
const filter_list = []; const filter_list = [];
const { const {
companyId, companyId,
carrier, carrierId,
vehicle, vehicle,
driver, driver,
status, status,
@@ -30,7 +30,7 @@ function getAndFilterList( query ){
} = query; } = query;
if( companyId ){ filter_list.push( { company : companyId } ); } if( companyId ){ filter_list.push( { company : companyId } ); }
if( carrier ){ filter_list.push( { carrier } ); } if( carrierId ){ filter_list.push( { carrier : carrierId } ); }
if( vehicle ){ filter_list.push( { vehicle } ); } if( vehicle ){ filter_list.push( { vehicle } ); }
if( driver ){ filter_list.push( { driver } ); } if( driver ){ filter_list.push( { driver } ); }
if( status ){ filter_list.push( { status } ); } if( status ){ filter_list.push( { status } ); }