Userprofile

1. I have added a second call to fetch the info i need for the profile page. I am wondering if this extra info shouldn't be returned from the auth call, because this breaks the current login test.

2. This profile page only works correctly when you log in as root. otherwise, it returns authorized.

3. should there be a separate endpoint to fetch and update the profile? I am currently using /users/
I have put that code in and pushed the branch.


On Tue, Jul 22, 2014 at 9:18 AM, Ryan Crichton <notifications@github.com>
wrote:

> In app/scripts/controllers/profile.js:
>
> > +    $scope.user =  Api.Users.get({ email: $scope.consoleSession.sessionUser }, function (userProfile) {
> > +      return userProfile;
> > +    });
> > +
> > +    var done = function () {
> > +      // reset backing object and refresh user profile
> > +      Api.Users.get({ email: $scope.consoleSession.
> sessionUser }, function (userProfile) {
> > +        $scope.user = userProfile;
> > +      });
> > +      $scope.alerts = [];
> > +      $scope.alerts.push({ type: 'success', msg: 'Your profile was successfully updated!' });
> > +    };
> > +
> > +    var saveUser = function (user) {
> > +      user.$update(user)
> > +        .then(done(user));
>
> Hey @debonair <https://github.com/debonair>, this still doesn't seem to
> work as expected. I've experimented a bit and the following seems to fix
> the problem:
>
> user.$update(function () { done(); });
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jembi/openhim-console/pull/40/files#r15213697>.
>



-- 
Duma Mtungwa
Software Developer
Mobile: +27 72 806 9205
-massacre-