Skip to content

Commit 4be3191

Browse files
committed
fix(client:userService): use id or _id property
1 parent 5ca8a56 commit 4be3191

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: templates/app/client/components/auth(auth)/user.service.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class UserService {
3131
.catch(this.handleError);
3232
}
3333
get(user = {id: 'me'}): Observable<UserType> {
34-
return this.AuthHttp.get(`/api/users/${user.id}`)
34+
return this.AuthHttp.get(`/api/users/${user.id || user._id}`)
3535
.map((res:Response) => res.json())
3636
.catch(this.handleError);
3737
}
@@ -41,13 +41,13 @@ export class UserService {
4141
.catch(this.handleError);
4242
}
4343
changePassword(user, oldPassword, newPassword) {
44-
return this.AuthHttp.put(`/api/users/${user.id}/password`, {oldPassword, newPassword})
44+
return this.AuthHttp.put(`/api/users/${user.id || user._id}/password`, {oldPassword, newPassword})
4545
.map((res:Response) => res.json())
4646
.catch(this.handleError);
4747
}
4848
remove(user) {
49-
return this.AuthHttp.delete(`/api/users/${user.id}`)
50-
.map((res:Response) => res.json())
49+
return this.AuthHttp.delete(`/api/users/${user.id || user._id}`)
50+
.map(() => user)
5151
.catch(this.handleError);
5252
}
5353
}

0 commit comments

Comments
 (0)