Shmuel
02/16/2022, 7:55 PMwhere
block, similar to laravel's when()
function.
https://laravel.com/docs/8.x/queries#conditional-clausesNurul
02/21/2022, 3:06 PMwhen
clauses inside where
block.
You would need to create a where clause before passing it in query.
Something like this
if(title) {
where = {
title: { contains: 'prisma' }
}
}
if(description) {
where ={
description: { contains: 'prisma' }
}
}
const result = await prisma.post.findMany(where)
Can you please create a new GitHub Issue explaining your exact use case?Shmuel
02/23/2022, 3:53 PM