salix/modules/ticket/back/methods/ticket/getVolume.js

27 lines
669 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: {
type: ['Object'],
root: true
},
http: {
path: `/:id/getVolume`,
verb: 'GET'
}
});
Self.getVolume = async ticketFk => {
let [volume] = await Self.rawSql(`CALL vn.ticketListVolume(?)`, [ticketFk]);
return volume;
};
};