Fix refresh token mecanism.

This commit is contained in:
Florian THIERRY
2024-09-04 08:58:47 +02:00
parent b091dc52b7
commit ca6b207816
5 changed files with 18 additions and 12 deletions

View File

@@ -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 });
});
}
}
}