This is my first time using Nuxt (v3). Last time I used Vue on a sizeable project was in 2020, but I've been reading the news so I'm not totally lost.
But I need help loading data from a backend server. I have read the Nuxt guide on loading data but I've still not figured out a solid pattern that works for all/most use cases.
I'm currently using this pattern: https://medium.com/@luizzappa/nuxt-3-repository-pattern-organising-and-managing-your-calls-to-apis-with-typescript-acd563a4e046
It seems to be working well so far (although I still want some adjustments, example not repeating .data) except that this page crashes with 500 from Nuxt dev server
Error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'id')
I know it's related to useRoute().prams.id because when I pass a string literal to getCases() method, it works. Is there guidance on the best way to approach this?