Skip to content

Instantly share code, notes, and snippets.

@dorwardv
Created February 25, 2015 16:29
Show Gist options
  • Save dorwardv/ab7d964d0d79152a821a to your computer and use it in GitHub Desktop.
Save dorwardv/ab7d964d0d79152a821a to your computer and use it in GitHub Desktop.
module.exports = function(Session) {
Session.search = function(boardTypes,vehicleTypes,preferences, cb) {
var msg = "select * from session";
Session.dataSource.connector.query(msg,function (err, sessions) {
if (err) {
console.error(err);
} else {
console.log(sessions);
}
cb(err, sessions);
});
}
Session.remoteMethod(
'search',
{
returns: {arg: 'sessions', type: ['Session'], root : true },
http: {'verb':'get'}
}
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment