@@ -12,10 +12,11 @@ export async function fetchAllData() {
1212 try {
1313 await new Promise ( r => setTimeout ( r , 800 ) ) ;
1414
15- const [ filmsRes , seriesRes , collectionsRes ] = await Promise . all ( [
15+ const [ filmsRes , seriesRes , collectionsRes , notifsRes ] = await Promise . all ( [
1616 fetch ( 'data/films.json' ) ,
1717 fetch ( 'data/series.json' ) ,
18- fetch ( 'data/collections.json' )
18+ fetch ( 'data/collections.json' ) ,
19+ fetch ( 'data/notifs.json' ) ,
1920 ] ) ;
2021
2122 if ( ! filmsRes . ok || ! seriesRes . ok ) throw new Error ( "Erreur de chargement des fichiers JSON (Films/Séries)" ) ;
@@ -30,10 +31,15 @@ export async function fetchAllData() {
3031 console . warn ( "Fichier collections.json non trouvé ou vide." ) ;
3132 }
3233
33- return { films, series, collections } ;
34+ const notifs = notifsRes . ok ? await notifsRes . json ( ) : [ ] ;
35+ if ( ! notifsRes . ok ) {
36+ console . warn ( "Fichier notifs.json non trouvé ou vide." ) ;
37+ }
38+
39+ return { films, series, collections, notifs } ;
3440 } catch ( error ) {
3541 console . error ( "Erreur Data Loader:" , error ) ;
36- return { films : { } , series : { } , collections : { } } ;
42+ return { films : { } , series : { } , collections : { } , notifs : { } } ;
3743 }
3844}
3945
0 commit comments