Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate promises return truncated user object #20

Closed
booleanbetrayal opened this issue Aug 28, 2014 · 2 comments · Fixed by #21
Closed

Validate promises return truncated user object #20

booleanbetrayal opened this issue Aug 28, 2014 · 2 comments · Fixed by #21

Comments

@booleanbetrayal
Copy link
Collaborator

Noticed that the following (JS dist) only returns the user ID upon success:

resolveDfd: function() {
  this.dfd.resolve({
    id: this.user.id
  });
  return $timeout(((function(_this) {
    return function() {
      _this.dfd = null;
      if (!$rootScope.$$phase) {
        return $rootScope.$digest();
      }
    };
  })(this)), 0);
},

I'm working on some route resolvers that could be simplified if this returned the full user. Otherwise, I'd need to hook into the rootScope events or make a separate API call. Is there a particular reason for the object truncation, or am I going about this all wrong? Thanks!

@lynndylanhurley
Copy link
Owner

I honestly can't remember why it only returns the ID.

I don't see any issues returning the complete user object - I'll make this change later today.

@booleanbetrayal
Copy link
Collaborator Author

Here's a PR in case it helps at all. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants