2017-07-06 06:45:33 +00:00
|
|
|
module.exports = function(FakeProduction) {
|
|
|
|
FakeProduction.remoteMethodCtx('routeList', {
|
|
|
|
description: 'Route list',
|
|
|
|
returns: {
|
|
|
|
arg: 'response',
|
|
|
|
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)
|
|
|
|
.then(function(response){
|
|
|
|
cb(null, response);
|
|
|
|
})
|
|
|
|
.catch(function(response){
|
|
|
|
cb(response, null);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|