withQSeach
Usage
import { withQSearch } from '@ra-libs/nestjs'
findAll(query: any): Promise<[Client[], number]> {
query = withQSearch(query, ["firstName", "lastName", "email", "document", "cellphone"])
const where = query.where || {};
return this.prisma.$transaction([
this.prisma.client.findMany(query),
this.prisma.client.count({ where }),
]);
}Last updated