File tree 1 file changed +4
-4
lines changed
templates/app/client/components/auth(auth)
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export class UserService {
31
31
. catch ( this . handleError ) ;
32
32
}
33
33
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 } ` )
35
35
. map ( ( res :Response ) => res . json ( ) )
36
36
. catch ( this . handleError ) ;
37
37
}
@@ -41,13 +41,13 @@ export class UserService {
41
41
. catch ( this . handleError ) ;
42
42
}
43
43
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} )
45
45
. map ( ( res :Response ) => res . json ( ) )
46
46
. catch ( this . handleError ) ;
47
47
}
48
48
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 )
51
51
. catch ( this . handleError ) ;
52
52
}
53
53
}
You can’t perform that action at this time.
0 commit comments