salix/back/methods/collection/getSectors.js

21 lines
480 B
JavaScript
Raw Normal View History

2020-03-23 07:24:57 +00:00
module.exports = Self => {
Self.remoteMethodCtx('getSectors', {
description: 'Get all sectors',
2020-03-26 12:12:59 +00:00
accessType: 'READ',
2020-03-23 07:24:57 +00:00
returns: {
type: 'Object',
root: true
},
http: {
path: `/getSectors`,
2020-03-26 12:12:59 +00:00
verb: 'GET'
2020-03-23 07:24:57 +00:00
}
});
Self.getSectors = async ctx => {
const query = `CALL vn.sector_get()`;
const [result] = await Self.rawSql(query, []);
return result;
};
};