is trpc + prisma right for my problem
Hello, let's say I want functionality add to favorites in my webapp. I have user session from next auth. Currently I am storing items inside User model in my database and then mutating and displaying items with help of trpc on frontend. But the problem is that all users see the same list of items. I have tried to filter it by user id but the issue is that now if one user adds Item to favorites, the other can not because its already there but filtered. Now I think that maybe I am overcomplicating it and should just use state management like zustand with local storage?
4 Replies
Yes trpc is the right way to go and Restructure your database table
Ahh I think I have tried that but don't know from where to get userId inside query (if that makes sense) code for displaying items:
Add where
Also no need of the try catch since your already await
Can do
Thx!