Skip to content

Commit

Permalink
feat: use contains for filter.name
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAlbDR committed Apr 16, 2024
1 parent 1149822 commit 35db4a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/presentation/users/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ export class UserService {
const [total, users] = await prisma.$transaction([
prisma.user.count({
where: {
username: filters.username,
username: filters.username
? { contains: filters.username }
: undefined,
role: filters.role,
contactInfo: { cityId: filters.cityId },
},
Expand All @@ -243,7 +245,9 @@ export class UserService {
skip: (page - 1) * limit,
take: limit,
where: {
username: filters.username,
username: filters.username
? { contains: filters.username }
: undefined,
role: filters.role,
contactInfo: { cityId: filters.cityId },
},
Expand Down

0 comments on commit 35db4a0

Please sign in to comment.