Skip to content

Instantly share code, notes, and snippets.

@boo1ean
Last active August 29, 2015 14:02
Show Gist options
  • Save boo1ean/85cd7be045a55b4e9621 to your computer and use it in GitHub Desktop.
Save boo1ean/85cd7be045a55b4e9621 to your computer and use it in GitHub Desktop.
var cats = require('services/cats');
var dogs = require('services/dogs');
var doStuff = function(data) {
whether(data.doge).then(function() {
return dogs.create(data).then(function(doge) {
data.doge_id = doge.id;
});
}).then(function() {
return cats.create(data);
});
};
module.exports = doStuff;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment