chore: update TypeScript build info cache
This commit is contained in:
@@ -158,9 +158,20 @@ export class PlaylistsComponent {
|
||||
if (!pl?.id || !user?.id || pl.userId !== user.id) return;
|
||||
const ok = confirm(`Supprimer la playlist "${pl.title}" ?`);
|
||||
if (!ok) return;
|
||||
this.http.delete(`${this.apiBase()}/playlists/${encodeURIComponent(pl.id)}`, { withCredentials: true }).subscribe({
|
||||
next: () => this.reload(this.searchQuery().trim() || undefined),
|
||||
error: (err) => this.error.set(err?.error?.error || err?.message || 'Échec de la suppression')
|
||||
|
||||
this.http.delete(`${this.apiBase()}/playlists/${encodeURIComponent(pl.id)}`, {
|
||||
withCredentials: true,
|
||||
responseType: 'text' // Handle empty response
|
||||
}).subscribe({
|
||||
next: () => {
|
||||
// Remove the playlist from the local list immediately for better UX
|
||||
this.playlists.set(this.playlists().filter(p => p.id !== pl.id));
|
||||
},
|
||||
error: (err) => {
|
||||
this.error.set(err?.error?.error || err?.message || 'Échec de la suppression');
|
||||
// Reload to ensure consistency with the server
|
||||
this.reload(this.searchQuery().trim() || undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user