26 lines
641 B
JavaScript
26 lines
641 B
JavaScript
module.exports = Self => {
|
|
Self.remoteMethod('getVolumes', {
|
|
description: 'Returns the volumes of a order',
|
|
accessType: 'READ',
|
|
accepts: [{
|
|
arg: 'id',
|
|
type: 'number',
|
|
required: true,
|
|
description: 'order id',
|
|
http: {source: 'path'}
|
|
}],
|
|
returns: {
|
|
arg: 'volumes'
|
|
},
|
|
http: {
|
|
path: `/:id/getVolumes`,
|
|
verb: 'GET'
|
|
}
|
|
});
|
|
|
|
Self.getVolumes = async orderFk => {
|
|
let [volume] = await Self.rawSql(`CALL vn.orderListVolume(?)`, [orderFk]);
|
|
return volume;
|
|
};
|
|
};
|