Skip to content

Commit

Permalink
Simplify andWhere condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaumaus committed Dec 15, 2024
1 parent a78f295 commit a405647
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions backend/apps/cloud/src/project/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,7 @@ export class ProjectService {

if (search?.trim()) {
queryBuilder
.andWhere(() => {
if (search?.trim()) {
return 'project.name LIKE :search'
}
return '1=1'
})
.andWhere('project.name LIKE :search')
.setParameter('search', search ? `%${search.trim()}%` : '')
}

Expand Down

0 comments on commit a405647

Please sign in to comment.