The Scenario
A dashboard needs data from 3 different microservices: User Profile, Recent Orders, and Support Tickets. Currently, the code uses `await fetchProfile()`, then `await fetchOrders()`, then `await fetchTickets()`. Each takes 1 second, so the page takes 3 seconds to load.
The Brief
Rewrite the code to fetch all 3 endpoints concurrently. Ensure that if the Support Tickets API fails, the User Profile and Recent Orders data are still returned to the frontend (with an error state for tickets).
Deliverables
- The optimized data-fetching code snippet
- An explanation of why `Promise.allSettled` is safer than `Promise.all` in this specific scenario
Submission Guidance
The goal is to reduce the total network time from 3 seconds to roughly 1 second. Pay close attention to error handling.
Submit Your Work
Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.