Skip to content

Commit

Permalink
fix(client:userService): use id or _id property
Browse files Browse the repository at this point in the history
  • Loading branch information
Awk34 committed Dec 26, 2016
1 parent 5ca8a56 commit 4be3191
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/app/client/components/auth(auth)/user.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class UserService {
.catch(this.handleError);
}
get(user = {id: 'me'}): Observable<UserType> {
return this.AuthHttp.get(`/api/users/${user.id}`)
return this.AuthHttp.get(`/api/users/${user.id || user._id}`)
.map((res:Response) => res.json())
.catch(this.handleError);
}
Expand All @@ -41,13 +41,13 @@ export class UserService {
.catch(this.handleError);
}
changePassword(user, oldPassword, newPassword) {
return this.AuthHttp.put(`/api/users/${user.id}/password`, {oldPassword, newPassword})
return this.AuthHttp.put(`/api/users/${user.id || user._id}/password`, {oldPassword, newPassword})
.map((res:Response) => res.json())
.catch(this.handleError);
}
remove(user) {
return this.AuthHttp.delete(`/api/users/${user.id}`)
.map((res:Response) => res.json())
return this.AuthHttp.delete(`/api/users/${user.id || user._id}`)
.map(() => user)
.catch(this.handleError);
}
}

0 comments on commit 4be3191

Please sign in to comment.