← Dashboard

πŸ“ Utente + Post

Fetch multipli e relazioni dati

πŸ“ Istruzioni

  1. Apri script.js e completa fetchUserAndPosts()
  2. Compila BASE_URL
  3. Fai due fetch: /users/{id} e /posts
  4. Usa filter() per relazionare i dati
πŸ’‘ 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().