Skip to content

Commit

Permalink
feat: fix projects search using display_name (#3159)
Browse files Browse the repository at this point in the history
  • Loading branch information
bistaastha committed Aug 6, 2024
1 parent 65dd8ad commit a9af115
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const ProjectPlatformParams: PlatformProjectParams = deepFreeze({
limit: 10,
offset: 0,
is_enabled: 'eq.true',
or: '(category_ids.is.null, category_ids.ov.{122269,122270,122271,122272,122273},name.ilike."%search%",sub_project.ilike."%search%")',
display_name: 'ilike."%search%"',
or: '(category_ids.is.null, category_ids.ov.{122269,122270,122271,122272,122273})',
id: 'in.(3943,305792,148971,247936)',
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export interface PlatformProjectParams {
org_id?: string;
name?: string;
or?: string;
display_name?: string;
}
3 changes: 1 addition & 2 deletions src/app/core/services/projects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ export class ProjectsService {

addNameSearchFilter(searchNameText: string, params: PlatformProjectParams): void {
if (typeof searchNameText !== 'undefined' && searchNameText) {
params.or = params.or ? `${params.or.slice(0, -1)},` : '(';
params.or += `name.ilike."%${searchNameText}%",sub_project.ilike."%${searchNameText}%")`;
params.display_name = `ilike."%${searchNameText}%"`;
}
}

Expand Down

0 comments on commit a9af115

Please sign in to comment.