Created
February 25, 2015 16:29
-
-
Save dorwardv/ab7d964d0d79152a821a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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