diff --git a/src/app/search/search.page.ts b/src/app/search/search.page.ts index 5df52b335e..8f39324463 100644 --- a/src/app/search/search.page.ts +++ b/src/app/search/search.page.ts @@ -259,8 +259,8 @@ export class SearchPage implements OnInit, AfterViewInit, OnDestroy, OnTabViewWi this.handleDeviceBackButton(); let frameworkCategory = this.appGlobalService.getCachedFrameworkCategory(); this.getCategoriesKeyForContent(frameworkCategory.id); - const rootOrgId = this.onboardingConfigurationService.getAppConfig().overriddenDefaultChannelId || '*'; - this.searchFilterConfig = await this.formAndFrameworkUtilService.getFrameworkCategoryList(frameworkCategory.id, {...FormConstants.SEARCH_FILTER, framework: frameworkCategory.id, rootOrgId: rootOrgId}); + const rootOrgId = this.onboardingConfigurationService.getAppConfig().overriddenDefaultChannelId; + this.searchFilterConfig = await this.formAndFrameworkUtilService.getFrameworkCategoryFilter(frameworkCategory.id, {...FormConstants.SEARCH_FILTER, framework: frameworkCategory.id, rootOrgId: rootOrgId}); if ((this.source === PageId.GROUP_DETAIL && this.isFirstLaunch) || this.preAppliedFilter) { this.isFirstLaunch = false; await this.handleSearch(true); diff --git a/src/services/formandframeworkutil.service.ts b/src/services/formandframeworkutil.service.ts index 60fc45f3c0..7268b1e541 100644 --- a/src/services/formandframeworkutil.service.ts +++ b/src/services/formandframeworkutil.service.ts @@ -758,6 +758,13 @@ export class FormAndFrameworkUtilService { return this.getFrameworkCategoryList(frameworkId, {...FormConstants.FRAMEWORK_CONFIG, framework: frameworkId, rootOrgId: (rootOrgId || '*')}, true) } + async getFrameworkCategoryFilter (frameworkId: string, formRequest?: any,) { + if (!formRequest.rootOrgId) { + formRequest.rootOrgId = await this.preferences.getString('defaultRootOrgId').toPromise(); + } + return this.getFrameworkCategoryList(frameworkId, formRequest) + } + getContentFrameworkCategory(frameworkId: string, rootOrgId?: string) { return this.getFrameworkCategoryList(frameworkId, {...FormConstants.CONTENT_FRAMEWORK_CONFIG, framework: frameworkId, rootOrgId: (rootOrgId || '*')}) } diff --git a/src/services/search-filter/search-filter.service.ts b/src/services/search-filter/search-filter.service.ts index 7d154ce2f6..4dfcd71ad3 100644 --- a/src/services/search-filter/search-filter.service.ts +++ b/src/services/search-filter/search-filter.service.ts @@ -29,9 +29,9 @@ export class SearchFilterService { const rootOrgId = this.onboardingConfigurationService.getAppConfig().overriddenDefaultChannelId try { this.facetFilterFormConfig = await this.formAndFrameworkUtilService - .getFrameworkCategoryList(frameworkId, {...FormConstants.FACET_FILTERS, rootOrgId: rootOrgId}); + .getFrameworkCategoryFilter(frameworkId, {...FormConstants.FACET_FILTERS, rootOrgId: rootOrgId}); } catch { - this.facetFilterFormConfig = await this.formAndFrameworkUtilService.getFrameworkCategoryList(frameworkId, {...FormConstants.FACET_FILTERS, rootOrgId: rootOrgId}); + this.facetFilterFormConfig = await this.formAndFrameworkUtilService.getFrameworkCategoryFilter(frameworkId, {...FormConstants.FACET_FILTERS, rootOrgId: rootOrgId}); } return this.facetFilterFormConfig; }