diff --git a/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.html b/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.html index a0662af388..b2eb27c99f 100644 --- a/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.html +++ b/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.html @@ -29,15 +29,7 @@
-
- -
+
+ liste$: Observable<{ id: string }[]> isOpen = false ngOnInit(): void { @@ -45,35 +41,4 @@ export class GpfApiDlListItemComponent implements OnInit { .get(`${this.link['id']}?limit=50`) .pipe(map((response) => response['entry'])) } - - async downloadMultipleFiles() { - this.liste$.pipe(take(1)).subscribe(async (fileUrls: { id: string }[]) => { - if (!fileUrls || fileUrls.length === 0) { - console.warn('Aucun fichier à télécharger.') - return - } - - for (const fileUrl of fileUrls) { - if (fileUrl?.id) { - await this.downloadFile(fileUrl.id) - } else { - console.warn('Fichier invalide :', fileUrl) - } - } - }) - } - - private downloadFile(url: string): Promise { - return new Promise((resolve) => { - setTimeout(() => { - const link = document.createElement('a') - link.href = url - link.setAttribute('download', '') - document.body.appendChild(link) - link.click() - document.body.removeChild(link) - resolve() - }, 1000) // Attendre 1s entre chaque téléchargement - }) - } }