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

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