Last active
August 17, 2016 03:37
-
-
Save tzechienchu/bc3e10ba84be5d9c084c3688ee28b4cb to your computer and use it in GitHub Desktop.
GeneratorWithPromise
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
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