X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Fusers%2Fuser.service.ts;h=f173c356a8ab2ba8c5f89f9e15d97c5cec085ae6;hb=e8bffe9690307f2686ed5573cae2b86ee5f57789;hp=a6a0474aba0e2ebd854cdd355a3128be6d9f67aa;hpb=a9bfa85d2cdf13670aaced740da5b493fbeddfce;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/core/users/user.service.ts b/client/src/app/core/users/user.service.ts index a6a0474ab..f173c356a 100644 --- a/client/src/app/core/users/user.service.ts +++ b/client/src/app/core/users/user.service.ts @@ -49,10 +49,7 @@ export class UserService { } return this.authHttp.put(url, body) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } changeEmail (password: string, newEmail: string) { @@ -63,10 +60,7 @@ export class UserService { } return this.authHttp.put(url, body) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } // --------------------------------------------------------------------------- @@ -90,20 +84,14 @@ export class UserService { const url = UserService.BASE_USERS_URL + 'me' return this.authHttp.put(url, profile) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } deleteMe () { const url = UserService.BASE_USERS_URL + 'me' return this.authHttp.delete(url) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } changeAvatar (avatarForm: FormData) { @@ -117,16 +105,12 @@ export class UserService { const url = UserService.BASE_USERS_URL + 'me/avatar' return this.authHttp.delete(url) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } signup (userCreate: UserRegister) { return this.authHttp.post(UserService.BASE_USERS_URL + 'register', userCreate) .pipe( - map(this.restExtractor.extractDataBool), tap(() => this.signupInThisSession = true), catchError(err => this.restExtractor.handleError(err)) ) @@ -143,10 +127,7 @@ export class UserService { const url = UserService.BASE_USERS_URL + '/ask-reset-password' return this.authHttp.post(url, { email }) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } resetPassword (userId: number, verificationString: string, password: string) { @@ -157,10 +138,7 @@ export class UserService { } return this.authHttp.post(url, body) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(res => this.restExtractor.handleError(res)) - ) + .pipe(catchError(res => this.restExtractor.handleError(res))) } verifyEmail (userId: number, verificationString: string, isPendingEmail: boolean) { @@ -171,20 +149,14 @@ export class UserService { } return this.authHttp.post(url, body) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(res => this.restExtractor.handleError(res)) - ) + .pipe(catchError(res => this.restExtractor.handleError(res))) } askSendVerifyEmail (email: string) { const url = UserService.BASE_USERS_URL + '/ask-send-verify-email' return this.authHttp.post(url, { email }) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } autocomplete (search: string): Observable { @@ -216,18 +188,12 @@ export class UserService { addUser (userCreate: UserCreate) { return this.authHttp.post(UserService.BASE_USERS_URL, userCreate) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } updateUser (userId: number, userUpdate: UserUpdate) { return this.authHttp.put(UserService.BASE_USERS_URL + userId, userUpdate) - .pipe( - map(this.restExtractor.extractDataBool), - catchError(err => this.restExtractor.handleError(err)) - ) + .pipe(catchError(err => this.restExtractor.handleError(err))) } updateUsers (users: UserServerModel[], userUpdate: UserUpdate) {