Replies: 1 comment 2 replies
|
Hey @NexZhu 👋 Your upsert statement needs to omit the const { id, ...upsertData } = data
await prisma.store.upsert({
where: { id },
create: upsertData,
update: upsertData,
})That should do it! |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
How to do "connect" updates on many-to-many relations? (in a transactional way)
In the docs, I only find docs for one-to-one and one-to-many relations.
My prisma models:
When I tried the following code to update a Store (similar to the way described in the docs for one-to-many relations):
I got the following error:
So how should I do it, apart from manually inserting to the relation table? Thank you for helping!
All reactions