Fix refresh token mecanism.
This commit is contained in:
@@ -53,7 +53,18 @@ export class PictureSelectionDialog implements OnInit {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
uploadPicture(file: any): void {
|
||||
console.log("uploadFile", file);
|
||||
uploadPicture(fileSelectionEvent: any): void {
|
||||
const pictureFile = fileSelectionEvent.target.files[0];
|
||||
if (pictureFile) {
|
||||
this.pictureRestService.uploadPicture(pictureFile)
|
||||
.then(pictureId => {
|
||||
this.dialogRef.close(pictureId);
|
||||
})
|
||||
.catch(error => {
|
||||
const errorMessage = 'A technical error occured while uploading your picture.';
|
||||
console.error(errorMessage, error);
|
||||
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user