Skip to content

Instantly share code, notes, and snippets.

@tzechienchu
Last active August 17, 2016 03:37
Show Gist options
  • Save tzechienchu/bc3e10ba84be5d9c084c3688ee28b4cb to your computer and use it in GitHub Desktop.
Save tzechienchu/bc3e10ba84be5d9c084c3688ee28b4cb to your computer and use it in GitHub Desktop.
GeneratorWithPromise
var co = require('co')
LogDive.testORM = function(cb) {
var query = {
"where": {"id": "1234567890"},
include: ['photos','comments','likes','owner',{user:'profile'}]
}
co(function*() {
var insts = yield DataTable.find(query);
console.log(insts);
cb(null,insts);
})
.catch(function(err) {
cb(err)
});
},
DataTable.remoteMethod(
'testORM',
{
http: {verb: 'get'},
returns: {arg: 'response', type: 'object'},
description:'Fix DataTable Profile'
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment