183. Report upload progress - Part 1 (#26)
This commit is contained in:
@ -242,15 +242,22 @@ export class UserComponent implements OnInit, OnDestroy {
|
||||
let subscription = this.userService.updateProfileImage(user.username, formData)
|
||||
.subscribe(
|
||||
(event: HttpEvent<any>) => {
|
||||
this.notificationService.notify(NotificationType.SUCCESS, `Profile image updated successfully: ${event}`);
|
||||
this.refreshing = false;
|
||||
this.getUsers(false);
|
||||
this.reportUploadProgress(event);
|
||||
},
|
||||
(errorResponse: HttpErrorResponse) => {
|
||||
this.sendErrorNotification(errorResponse.error.message);
|
||||
this.refreshing = false;
|
||||
},
|
||||
() => {
|
||||
this.notificationService.notify(NotificationType.SUCCESS, `Profile image updated successfully: ${event}`);
|
||||
this.refreshing = false;
|
||||
this.getUsers(false);
|
||||
}
|
||||
);
|
||||
this.subscriptions.push(subscription);
|
||||
}
|
||||
|
||||
private reportUploadProgress(event: HttpEvent<any>): void {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
import { FileUpload.Status } from './file-upload.status';
|
||||
|
||||
describe('FileUpload.Status', () => {
|
||||
it('should create an instance', () => {
|
||||
expect(new FileUpload.Status()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
export class FileUploadStatus {
|
||||
|
||||
public status: string = '';
|
||||
public percentage: number = 0;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user