MOBILE-2900 courses: Exclude enrolled user count from WS call

main
Albert Gasset 2019-03-13 11:28:36 +01:00
parent e3690ab2c6
commit b23881299c
2 changed files with 8 additions and 2 deletions

View File

@ -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.

View File

@ -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);
});
}