22 lines
524 B
JavaScript
22 lines
524 B
JavaScript
module.exports = Self => {
|
|
Self.remoteMethod('getAddress', {
|
|
description: 'Get all activated address client active',
|
|
accessType: 'READ',
|
|
accepts: [],
|
|
returns: {
|
|
type: ['object'],
|
|
root: true
|
|
},
|
|
http: {
|
|
path: `/getAddress`,
|
|
verb: 'GET'
|
|
}
|
|
});
|
|
|
|
Self.getAddress = async() => {
|
|
const query = `CALL vn.address_getLoses()`;
|
|
const [result] = await Self.rawSql(query);
|
|
return result;
|
|
};
|
|
};
|