From 7d183929d7fc53e8e441d2a1303cafbb93991519 Mon Sep 17 00:00:00 2001 From: Berack96 Date: Wed, 11 Feb 2026 22:05:18 +0100 Subject: [PATCH] fix 11e3 --- .../03_utente_e_post/index.html | 23 ------------------- .../03_utente_e_post/script.js | 2 ++ 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/javascript/JS_Esercizi 11 - API/03_utente_e_post/index.html b/javascript/JS_Esercizi 11 - API/03_utente_e_post/index.html index 8f2e5d1..e60063c 100644 --- a/javascript/JS_Esercizi 11 - API/03_utente_e_post/index.html +++ b/javascript/JS_Esercizi 11 - API/03_utente_e_post/index.html @@ -32,29 +32,6 @@
- - -
-

๐Ÿ“ Istruzioni

-
    -
  1. Apri script.js e completa fetchUserAndPosts()
  2. -
  3. Compila BASE_URL
  4. -
  5. Fai due fetch: /users/{id} e /posts
  6. -
  7. Usa filter() per relazionare i dati
  8. -
- -
- ๐Ÿ’ก Suggerimento: -
const user = await fetch(...);
-const allPosts = await fetch(...);
-const userPosts = allPosts.filter(post => post.userId === user.id);
-
- -
- ๐ŸŽฏ Bonus Challenge: -

Ordina i post dal piรน recente al meno recente usando sort().

-
-
diff --git a/javascript/JS_Esercizi 11 - API/03_utente_e_post/script.js b/javascript/JS_Esercizi 11 - API/03_utente_e_post/script.js index f8d0f38..30ec8ec 100644 --- a/javascript/JS_Esercizi 11 - API/03_utente_e_post/script.js +++ b/javascript/JS_Esercizi 11 - API/03_utente_e_post/script.js @@ -117,6 +117,8 @@ function handleError(message) { * 8. Gestisci gli errori con handleError() */ async function fetchUserAndPosts() { + // TODO Rimuovi questa riga e completa la funzione + handleError('Codice non implementato - Completa la funzione fetchUserAndPosts()'); }