fix(loads): populate company and carrier fields
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
const { ROOT_PATH, LIB_PATH, MODELS_PATH, HANDLERS_PATH } = process.env;
|
||||
const { getPagination , queryPage } = require( `${ROOT_PATH}/${LIB_PATH}/Misc.js` );
|
||||
const { getPagination , getPage } = require( `${ROOT_PATH}/${LIB_PATH}/Misc.js` );
|
||||
const Model = require( `${ROOT_PATH}/${MODELS_PATH}/load-attachments.model.js` );
|
||||
const UserModel = require( `${ROOT_PATH}/${MODELS_PATH}/users.model.js` );
|
||||
const LoadsModel = require( `${ROOT_PATH}/${MODELS_PATH}/loads.model.js` );
|
||||
@@ -32,7 +32,7 @@ const getAttachment = async(req, res) => {
|
||||
const getAttachmentList = async(req, res) => {
|
||||
const filter = await getAuthorizationFilter( req.JWT.payload.sub );
|
||||
const { page , elements } = getPagination( req.query );
|
||||
const retVal = await queryPage( page, elements, Model, filter );
|
||||
const retVal = await getPage( page, elements, Model, filter );
|
||||
res.send( retVal );
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ const getLoadAttachmentList = async(req, res) => {
|
||||
]
|
||||
};
|
||||
const { page , elements } = getPagination( req.query );
|
||||
const retVal = await queryPage( page, elements, Model, filter );
|
||||
const retVal = await getPage( page, elements, Model, filter );
|
||||
res.send( retVal );
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user