Skip to content
This repository

Allow res to be passed as orm callback for standard usage #282

Closed
mikermcneil opened this Issue · 1 comment

2 participants

Mike McNeil Courtney Wyrtzen
Mike McNeil
Owner

In your controllers, instead of:

User.findAll().done(function (err, users) {
  if (err) res.send(err,500);
  else if (res.viewExists) res.view({ models: users });
  else res.json(users);
});

You'd be able to do:

User.findAll().done(res);

Which can actually be optimized internally to:

User.stream().pipe(res);
Courtney Wyrtzen
Collaborator

Noted~

Courtney Wyrtzen CWyrtzen closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.