salix/services/production/common/methods/fake-production/route.js

27 lines
810 B
JavaScript
Raw Normal View History

2017-07-06 06:45:33 +00:00
module.exports = function(FakeProduction) {
FakeProduction.remoteMethodCtx('routeList', {
description: 'Route list',
returns: {
arg: 'response',
2017-07-06 06:45:33 +00:00
type: 'message'
},
http: {
path: '/routeList',
verb: 'get'
}
});
FakeProduction.routeList = function(ctx, cb) {
2017-10-10 09:09:47 +00:00
// var query = `select routeFk from FakeProduction where routeFk is not null group by RouteFk order by routeFk`;
let query = `call salix.production_control_source(1,1)`;
2017-07-06 06:45:33 +00:00
var params = [];
FakeProduction.rawSql(query, params, cb)
2017-10-31 08:26:11 +00:00
.then(function(response) {
2017-07-06 06:45:33 +00:00
cb(null, response);
})
2017-10-31 08:26:11 +00:00
.catch(function(response) {
2017-07-06 06:45:33 +00:00
cb(response, null);
});
2017-10-31 08:26:11 +00:00
};
};