Can't figure out how to disconnect in prisma
I've been trying to figure out how to disconnect
feed
from user
for like 2 hours now, and I can't figure out what part I'm getting wrong, my function looks like this:
But on the id: input.feedId
, I get Type '{ id: string; }' is not assignable to type 'UserFeedsWhereUniqueInput'.
Does anyone know how to make it, so it removes the Feed
from the User
?
Here's my schema:
5 Replies
try it with disconnect like:
Unfortunately, that doesn't work and just returns
Type '{ id: string; }' is not assignable to type 'Enumerable<UserFeedsWhereUniqueInput> | undefined'.
Having an explicit
UserFeeds
join table makes this tricky, on top of the fact that it's got a compound ID.
What you're disconnecting in Feeds:
isn't actually a Feed
, so it doesn't know what the id
field is. Instead you need to give it a feedId
and userId
, since they compose the primary key of UserFeeds
, which is the actual model you're operating on.Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Ok i did that and it worked
thanks