diff --git a/support-portal-frontend/src/app/component/user/user.component.ts b/support-portal-frontend/src/app/component/user/user.component.ts index 1ac8c29..303319e 100644 --- a/support-portal-frontend/src/app/component/user/user.component.ts +++ b/support-portal-frontend/src/app/component/user/user.component.ts @@ -247,7 +247,7 @@ export class UserComponent implements OnInit, OnDestroy { const formData = new FormData(); formData.append("profileImage", this.profileImage); let user = this.authenticationService.getUserFromLocalStorage(); - this.subs.sink = this.userService.updateProfileImage(user.username, formData) + this.subs.sink = this.userService.updateProfileImage(user.userId, formData) .subscribe( (event: HttpEvent) => { this.reportUploadProgress(event); diff --git a/support-portal-frontend/src/app/service/user.service.ts b/support-portal-frontend/src/app/service/user.service.ts index 2fc5c26..1d66463 100644 --- a/support-portal-frontend/src/app/service/user.service.ts +++ b/support-portal-frontend/src/app/service/user.service.ts @@ -36,9 +36,9 @@ export class UserService { .post(`${this.host}/user/resetPassword/${email}`, null); } - public updateProfileImage(username: string, formData: FormData): Observable> { + public updateProfileImage(userId: string, formData: FormData): Observable> { return this.httpClient - .put(`${this.host}/user/${username}/profileImage`, formData, + .put(`${this.host}/user/${userId}/profile-image`, formData, { reportProgress: true, observe: 'events'