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

25 lines
738 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',
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);
});
}
}