salix/services/loopback/common/methods/agency/landsThatDay.js

28 lines
733 B
JavaScript
Raw Normal View History

2018-07-09 11:54:43 +00:00
module.exports = Self => {
Self.remoteMethod('landsThatDay', {
description: 'Returns a list of agencies that can land a shipment on a day for an address',
accessType: '',
accepts: [{
arg: 'filter',
type: 'object',
required: true,
description: 'addressFk'
}],
returns: {
type: 'object',
root: true
},
http: {
path: `/landsThatDay`,
verb: 'get'
}
});
Self.landsThatDay = async filter => {
let query = `CALL vn.agencyHourGetAgency(?, ?)`;
let result = await Self.rawSql(query, [filter.addressFk, filter.landed]);
return result;
};
};