Skip to content

Commit

Permalink
case insensitive search
Browse files Browse the repository at this point in the history
  • Loading branch information
tongo-angelov committed Aug 7, 2023
1 parent ebd4fe4 commit 7c3e7d5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/api/src/donation-wish/donation-wish.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
import { CreateDonationWishDto } from './dto/create-donation-wish.dto'
import { Prisma } from '@prisma/client'

@Injectable()
export class DonationWishService {
Expand All @@ -21,7 +22,7 @@ export class DonationWishService {
pageIndex?: number,
pageSize?: number,
) {
const whereClause = {
const whereClause: Prisma.DonationWishWhereInput = {
campaignId: campaignId,
donation: {
amount: {
Expand All @@ -35,15 +36,15 @@ export class DonationWishService {
},
...(search && {
OR: [
{ message: { contains: search } },
{ message: { contains: search, mode: 'insensitive' } },
{
person: {
OR: [
{
firstName: { contains: search },
firstName: { contains: search, mode: 'insensitive' },
},
{
lastName: { contains: search },
lastName: { contains: search, mode: 'insensitive' },
},
],
},
Expand Down

0 comments on commit 7c3e7d5

Please sign in to comment.