Join Slack
Powered by
Will prisma ignore undefined property defined insi...
# orm-help
g
Gelo
02/09/2022, 6:14 AM
Will prisma ignore undefined property defined inside where clause?
s
Sabin Adams
02/09/2022, 7:53 AM
It will indeed!
https://www.prisma.io/docs/concepts/components/prisma-client/null-and-undefined
👍 1
Sabin Adams
02/09/2022, 7:54 AM
What you have there is the equivalent of:
Copy code
AND: [ { id }, ...( user.isAdmin || user.isApprover ? {} : { userId: user.id }) ]
❤️ 3
Open in Slack
Previous
Next