gestion des erreurs dans quand on ajoute une video dans une playlist

This commit is contained in:
MiharyR 2021-12-14 18:44:05 +01:00
parent 95e88f93ab
commit c1ecb3cb5e
6 changed files with 86 additions and 73 deletions

View file

@ -46,16 +46,22 @@ export class PageMyPlaylistsComponent implements OnInit
transmitPlaylistToVideoList(playlist): void
{
this.messageService
.get("playlist/findOne/"+playlist.id)
.subscribe(ret => this.afterReceivingPlaylistWithVideo(ret), err => this.afterReceivingPlaylistWithVideo(err));
if ((playlist === null) || (playlist === undefined)) {
this.playlist = playlist;
}
else {
this.messageService
.get("playlist/findOne/" + playlist.id)
.subscribe(ret => this.afterReceivingPlaylistWithVideo(ret, playlist), err => this.afterReceivingPlaylistWithVideo(err, playlist));
}
}
afterReceivingPlaylistWithVideo(retour: any): void
afterReceivingPlaylistWithVideo(retour: any, playlist): void
{
if(retour.status !== "success") {
console.log(retour);
this.playlist = playlist;
}
else {
this.playlist = retour.data;