-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update soft delete middleware docs about findFirstOrThrow
and findUniqueOrThrow
#5392
Update soft delete middleware docs about findFirstOrThrow
and findUniqueOrThrow
#5392
Conversation
@Kwontaehwon is attempting to deploy a commit to the Prisma Team on Vercel. A member of the Team first needs to authorize it. |
...t/200-concepts/100-components/02-prisma-client/054-middleware/100-soft-delete-middleware.mdx
Outdated
Show resolved
Hide resolved
Should we also update the example on the page to cover these then? |
…eware/100-soft-delete-middleware.mdx Co-authored-by: Jan Piotrowski <[email protected]>
…w-findUnqiueOrThrow
…ow queries in soft delete middleware
…ies in soft delete middlware
@janpio Thanks for review! I changed example code to support |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you very much for the contribution @Kwontaehwon ! I'm running our test suite to confirm that everything looks good and then will get this merged. |
...t/200-concepts/100-components/02-prisma-client/054-middleware/100-soft-delete-middleware.mdx
Outdated
Show resolved
Hide resolved
@jharrell It seems like something went wrong during the distribution process. This is my first contribution so I don't know what to do. What should I do? |
@Kwontaehwon that's an issue on our side. Everything looks good and I'm merging. Thank you again for your contribution! |
Describe this PR
While working on my project and referring to the official docs, I used a soft delete middleware and started using
findFirstOrThrow
andfindUniqueOrThrow
. However, I noticed that these two queries can't apply soft delete.At that time, the prisma/client version I was using missed the
prismaAction
type forfindFirstOrThrow
andfindUniqueOrThrow
, preventing me from applying this feature.However, through prisma/prisma#17471,
these two queries were added to the
prismaAction
type in prisma/client version 5.1.0.Currently, there is no information related to this in the soft delete documentation.
https://www.prisma.io/docs/concepts/components/prisma-client/middleware/soft-delete-middleware#option-2-use-middleware-to-determine-the-behavior-of-readupdate-queries-for-deleted-records
Therefore, we should add information regarding how to enable soft delete middleware with
findFirstOrThrow
andfindUniqueOrThrow
from Prisma/client version 5.1.0 onwards.Changes
findFirstOrThrow
andfindUniqueOrThrow
is available after 5.1.0 version.What issue does this fix?
Fixes #5391
Any other relevant information