Skip to content

Instantly share code, notes, and snippets.

@lrvick
Created November 3, 2012 19:27
Show Gist options
  • Save lrvick/4008385 to your computer and use it in GitHub Desktop.
Save lrvick/4008385 to your computer and use it in GitHub Desktop.
async.waterfall [
(cb) ->
if user?.id
models.execute User, 'find', user.id, (err,user) ->
cb null, err, userModel
else
cb null, null, null
(err, userModel, cb) ->
models.execute db, 'query', getClosetsSql(userModel, catalogSqlParams),
User, null, (err, pUsers) ->
cb null, err, userModel, pUsers
] , (err, [userModel, pUsers]) ->
if err?
console.error "Unable to load closets: #{util.inspect err}"
callback(err)
console.log 'PUSERS',pUsers
pUsersPackaged = packagePUsers(userModel?.id, pUsers)
callback null,
user: userModel
pUsers: pUsersPackaged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment