File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
templates/app/client/components/auth(auth) Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments