Skip to content

Instantly share code, notes, and snippets.

@KarbonDallas
Forked from tbergeron/gist:3874370
Created October 11, 2012 18:11
Show Gist options
  • Save KarbonDallas/3874404 to your computer and use it in GitHub Desktop.
Save KarbonDallas/3874404 to your computer and use it in GitHub Desktop.
list: function(req, res, params) {
var that = this;
function stepOne(userIsLogged) {
that
.Users
.getUserByUserID(
req.session.userId
, stepTwo
)
;
});
function stepTwo(user) {
params.firstName = user.firstName;
that.Elements.getElementsByUserID(req.session.userId, stepThree);
}
function stepThree(elements) {
params.elements = elements;
that.sendTemplate(req, res, 'elements/list', params)
}
this
.helpers
.user
.checkIfUserIsLogged(
req
, res
, '/login'
, stepOne
)
;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment