fix: Add shipment_code to loads find filter
This commit is contained in:
@@ -11,7 +11,7 @@ const generic = new GenericHandler( Model, null, populate_list );
|
||||
|
||||
function getAndFilterList( query ){
|
||||
const filter_list = [];
|
||||
const { status, posted_by_name, load_status, published_date, loaded_date, transit_date, categories, product } = query;
|
||||
const { status, posted_by_name, load_status, published_date, loaded_date, transit_date, categories, product, shipment_code } = query;
|
||||
|
||||
if( status ){ filter_list.push( { status } ); }
|
||||
if( posted_by_name ) { filter_list.push({ posted_by_name }); }
|
||||
@@ -21,6 +21,8 @@ function getAndFilterList( query ){
|
||||
if( transit_date ) { filter_list.push({ transit_date }); }
|
||||
if( categories ) { filter_list.push({ categories }); }
|
||||
if( product ) { filter_list.push({ product }); }
|
||||
if( shipment_code ) { filter_list.push({ shipment_code }); }
|
||||
|
||||
|
||||
if( filter_list.length == 0 ){
|
||||
return null;
|
||||
|
||||
@@ -58,7 +58,6 @@ async function findElements( companyId , query ){
|
||||
}else{
|
||||
filter = { company : companyId };
|
||||
}
|
||||
console.log( filter );
|
||||
const { total , limit, skip, data } = await generic.getList( page , elements, filter );
|
||||
return {
|
||||
total,
|
||||
|
||||
Reference in New Issue
Block a user