Skip to content

Commit

Permalink
Merge pull request #3546 from Ajoymaity/release-7.0.0
Browse files Browse the repository at this point in the history
Issue #ED-3513 fix: Fixed browse by subject for new framework
  • Loading branch information
swayangjit authored Feb 19, 2024
2 parents 3373b16 + 38771f7 commit ca4e9e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/home/user-home/user-home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ export class UserHomePage implements OnInit, OnDestroy, OnTabViewWillEnter {
return contentSearchCriteria;
}, from: refresher ? CachedItemRequestSourceFrom.SERVER : CachedItemRequestSourceFrom.CACHE
};
const rootOrgId = this.onboardingConfigurationService.getAppConfig().overriddenDefaultChannelId
let displayItems = await this.contentAggregatorHandler.newAggregate(request, AggregatorPageType.HOME, rootOrgId);
const rootOrgId = this.onboardingConfigurationService.getAppConfig().overriddenDefaultChannelId;
let displayItems = await this.contentAggregatorHandler.newAggregate(request, AggregatorPageType.HOME, rootOrgId, this.profile.syllabus[0]);
await this.getOtherMLCategories();
displayItems = this.mapContentFacteTheme(displayItems);
this.checkHomeData(displayItems);
Expand Down
10 changes: 7 additions & 3 deletions src/services/content/content-aggregator-handler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Inject, Injectable } from '@angular/core';
import { FormConstants } from '../../app/form.constants';
import {
ContentAggregatorResponse, ContentService, CourseService,
FormService, ProfileService
FormService, ProfileService, SharedPreferences
} from '@project-sunbird/sunbird-sdk';
import { DataSourceType } from '@project-sunbird/sunbird-sdk/content/handlers/content-aggregator';
import { AppGlobalService } from '../app-global-service.service';
Expand All @@ -26,6 +26,7 @@ export class ContentAggregatorHandler {
@Inject('FORM_SERVICE') private formService: FormService,
@Inject('PROFILE_SERVICE') private profileService: ProfileService,
@Inject('CONTENT_SERVICE') private contentService: ContentService,
@Inject('SHARED_PREFERENCES') private preferences: SharedPreferences,
public commonUtilService: CommonUtilService,
private appGlobalService: AppGlobalService,
) { }
Expand Down Expand Up @@ -68,16 +69,19 @@ export class ContentAggregatorHandler {
}


async newAggregate(request, pageName: AggregatorPageType, rootOrgId?: string): Promise<any> {
async newAggregate(request, pageName: AggregatorPageType, rootOrgId?: string, frameworkId?: string): Promise<any> {
let dataSrc: DataSourceType[] = ['TRACKABLE_COLLECTIONS'];

if (this.appGlobalService.isUserLoggedIn()) {
dataSrc = [];
}
if (!rootOrgId) {
rootOrgId = await this.preferences.getString('defaultRootOrgId').toPromise();
}

try {
this.aggregatorResponse = await this.aggregateContent(request, dataSrc,
{...FormConstants.CONTENT_AGGREGATOR, subType: pageName, rootOrgId: rootOrgId || '*'});
{...FormConstants.CONTENT_AGGREGATOR, subType: pageName, framework: frameworkId || '*', rootOrgId: rootOrgId || '*'});
return this.aggregatorResponse.result;
} catch (e) {
console.error(e);
Expand Down

0 comments on commit ca4e9e7

Please sign in to comment.