2020-03-23 07:24:57 +00:00
|
|
|
module.exports = Self => {
|
2020-03-26 18:10:09 +00:00
|
|
|
Self.remoteMethod('getSectors', {
|
2020-03-23 07:24:57 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-03-26 18:10:09 +00:00
|
|
|
Self.getSectors = async() => {
|
2020-03-23 07:24:57 +00:00
|
|
|
const query = `CALL vn.sector_get()`;
|
2020-03-26 18:10:09 +00:00
|
|
|
const [result] = await Self.rawSql(query);
|
2020-03-23 07:24:57 +00:00
|
|
|
return result;
|
|
|
|
};
|
|
|
|
};
|