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

29 lines
821 B
JavaScript

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) {
// 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)`;
var params = [];
FakeProduction.rawSql(query, params, cb)
.then(function(response) {
cb(null, response);
})
.catch(function(response) {
cb(response, null);
});
};
};