29 lines
678 B
JavaScript
29 lines
678 B
JavaScript
module.exports = Self => {
|
|
Self.remoteMethod('getTaxes', {
|
|
description: 'Returns ticket taxes',
|
|
accessType: 'READ',
|
|
accepts: [{
|
|
arg: 'id',
|
|
type: 'number',
|
|
required: true,
|
|
description: 'ticket id',
|
|
http: {source: 'path'}
|
|
}],
|
|
returns: {
|
|
type: 'number',
|
|
root: true
|
|
},
|
|
http: {
|
|
path: `/:id/getTaxes`,
|
|
verb: 'GET'
|
|
}
|
|
});
|
|
|
|
Self.getTaxes = async ticketFk => {
|
|
let query = `CALL vn.ticketGetTaxAdd(?)`;
|
|
let [taxes] = await Self.rawSql(query, [ticketFk]);
|
|
|
|
return taxes;
|
|
};
|
|
};
|