diff --git a/src/app/core/mock-data/platform/v1/platform-projects-params.data.ts b/src/app/core/mock-data/platform/v1/platform-projects-params.data.ts index f52d65ff55..83a92f2823 100644 --- a/src/app/core/mock-data/platform/v1/platform-projects-params.data.ts +++ b/src/app/core/mock-data/platform/v1/platform-projects-params.data.ts @@ -7,7 +7,6 @@ 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})', + or: '(category_ids.is.null, category_ids.ov.{122269,122270,122271,122272,122273},name.ilike."%search%",sub_project.ilike."%search%")', id: 'in.(3943,305792,148971,247936)', - name: 'ilike.%search%', }); diff --git a/src/app/core/services/projects.service.ts b/src/app/core/services/projects.service.ts index 42dad67abb..1db1704d9f 100644 --- a/src/app/core/services/projects.service.ts +++ b/src/app/core/services/projects.service.ts @@ -48,12 +48,12 @@ export class ProjectsService { // `orgCategoryIds` can be optional this.addOrgCategoryIdsFilter(orgCategoryIds, params); - // `projectIds` can be optional - this.addProjectIdsFilter(projectIds, params); - // `searchNameText` can be optional this.addNameSearchFilter(searchNameText, params); + // `projectIds` can be optional + this.addProjectIdsFilter(projectIds, params); + return this.spenderPlatformV1ApiService .get>('/projects', { params, @@ -83,7 +83,8 @@ export class ProjectsService { addNameSearchFilter(searchNameText: string, params: PlatformProjectParams): void { if (typeof searchNameText !== 'undefined' && searchNameText !== null) { - params.name = 'ilike.%' + searchNameText + '%'; + params.or = params.or ? `${params.or.slice(0, -1)},` : '('; + params.or += `name.ilike."%${searchNameText}%",sub_project.ilike."%${searchNameText}%")`; } }