From b23881299c1a5b172c1e94bdd5eb51a37369d6db Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Wed, 13 Mar 2019 11:28:36 +0100 Subject: [PATCH] MOBILE-2900 courses: Exclude enrolled user count from WS call --- src/classes/site.ts | 3 ++- src/core/courses/providers/courses.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/classes/site.ts b/src/classes/site.ts index 04d133a2c..2a0bf52a3 100644 --- a/src/classes/site.ts +++ b/src/classes/site.ts @@ -176,7 +176,8 @@ export class CoreSite { 3.3: 2017051503, 3.4: 2017111300, 3.5: 2018051700, - 3.6: 2018120300 + 3.6: 2018120300, + 3.7: 2019030700 // @todo: Replace it with the right 3.7 date when released }; // Rest of variables. diff --git a/src/core/courses/providers/courses.ts b/src/core/courses/providers/courses.ts index d4e492aa8..42e3ff7c5 100644 --- a/src/core/courses/providers/courses.ts +++ b/src/core/courses/providers/courses.ts @@ -682,14 +682,19 @@ export class CoreCoursesProvider { return this.sitesProvider.getSite(siteId).then((site) => { const userId = site.getUserId(), - data = { + data: any = { userid: userId }, preSets = { cacheKey: this.getUserCoursesCacheKey(), + getCacheUsingCacheKey: true, omitExpires: !!preferCache }; + if (site.isVersionGreaterEqualThan('3.7')) { + data.returnusercount = 0; + } + return site.read('core_enrol_get_users_courses', data, preSets); }); }