- .then(resp => ({
- email: resp.data.email,
- firstName: resp.data.first_name,
- lastName: resp.data.last_name,
- uuid: resp.data.uuid,
- ownerUuid: resp.data.owner_uuid
- }));
+ .then(resp => {
+ this.actions.progressFn(reqId, false);
+ const prefs = resp.data.prefs.profile ? resp.data.prefs : { profile: {}};
+ console.log(resp.data);
+ return {
+ email: resp.data.email,
+ firstName: resp.data.first_name,
+ lastName: resp.data.last_name,
+ uuid: resp.data.uuid,
+ ownerUuid: resp.data.owner_uuid,
+ isAdmin: resp.data.is_admin,
+ identityUrl: resp.data.identity_url,
+ prefs
+ };
+ })
+ .catch(e => {
+ this.actions.progressFn(reqId, false);
+ this.actions.errorFn(reqId, e);
+ throw e;
+ });