Last active
August 29, 2015 13:59
-
-
Save qcom/10676433 to your computer and use it in GitHub Desktop.
oh control flow I don't understand you
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
// app.get('db') is a reference to my wrapper module over knex.js | |
// which just bundles actions/behavior into entity-named properties (tag, jobIndustries, etc.) | |
app.get('db').tag.getBelongingToJob(job.job_id) | |
.then(function(tags) { | |
job.tags = tags; | |
return app.get('db').jobIndustries.get(job.job_industry); | |
}).then(function(jobIndustry) { | |
job.job_industry = jobIndustry; | |
return app.get('db').jobCategories.get(job.job_category); | |
}).then(function(jobCategory) { | |
job.job_category = jobCategory; | |
return app.get('db').company.get(job.company_id); | |
}).then(function(company) { | |
job.company = company; | |
req.job = job; | |
next(); | |
}); |
benjamingr
commented
Apr 14, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment