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! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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!
Beta Was this translation helpful? Give feedback.
All reactions