Closed ObserverMoment closed 3 years ago
I can not check if the user tries to delete one or many, so many works with both. I think the right idea to make delete parent false, and you can delete the parent in your side is you can select what you need
I see, yeah that should work! Thanks will try that.
Hi, thanks for the last quick update.
Returnfields
is a great idea but there seems to be an issue in that prisma.deleteMany() return aBatchPayload
object rather than the original model, which only has one field on it -count
.Wondering if my syntax is wrong or if there is some other fix / update that would allow the functionality to work?
Perhaps switch the final return statement (when deleting the initial parent) to a standard
prisma.delete()
?https://github.com/paljs/prisma-tools/blob/7b657d3c4b444dda58ca122f2cfdd0394bae6727/packages/plugins/src/delete.ts#L158