25 lines
613 B
JavaScript
25 lines
613 B
JavaScript
module.exports = Self => {
|
|
Self.remoteMethod('getVolume', {
|
|
description: 'Returns the volumes of a ticket',
|
|
accessType: 'READ',
|
|
accepts: [{
|
|
arg: 'id',
|
|
type: 'number',
|
|
required: true,
|
|
description: 'ticket id',
|
|
http: {source: 'path'}
|
|
}],
|
|
returns: {
|
|
arg: 'volumes'
|
|
},
|
|
http: {
|
|
path: `/:id/getVolume`,
|
|
verb: 'GET'
|
|
}
|
|
});
|
|
|
|
Self.getVolume = async ticketFk => {
|
|
return await Self.rawSql(`CALL vn.ticketListVolume(?);`, [ticketFk]);
|
|
};
|
|
};
|