findMany() vs findMany({...})
In the db.ts its nicely returns the counties as expected.
However in the lists.ts its empty.
I've tried lot of versions and directy query or if i pass {where, selecet..} details to findMany, then it works in the getUKCounties too.
So these works well:
I just started to use prisma, and while I found solution, I would be curious why in db.ts works simpty findMany, but not in the lists.ts
3 Replies
You decided to hold for human wisdom. We'll chime in soon! Meanwhile,
#ask-ai
is there if you need a quick second opinion.Do you get any errors in list.ts file?
How are you invoking
getUKCounties
in list.ts file?No errors. Just an empty []
in the db.ts
log:
Counties: [ { id: 1, name: 'test' }, { id: 2, name: 'Test' } ]
But in lists.ts
log:
FindMany result: []
This is where I call the lists.ts
But I when I change the getUKCounties to get the counties like:
Its works just fine