salix/back/methods/collection/getAddress.js

21 lines
506 B
JavaScript

module.exports = Self => {
Self.remoteMethod('getAddress', {
description: 'Get all activated address last year ',
accessType: 'READ',
returns: {
type: 'Object',
root: true
},
http: {
path: `/getAddress`,
verb: 'GET'
}
});
Self.getAddress = async() => {
const query = `CALL vn.address_getLosesLastYear()`;
const [result] = await Self.rawSql(query);
return result;
};
};