MOBILE-2858 courses: Do not check course options on empty list
parent
442c184ac0
commit
e891fcb1a1
|
@ -555,6 +555,10 @@ export class CoreCoursesProvider {
|
||||||
* @return {Promise<any>} Promise resolved with administration options for each course.
|
* @return {Promise<any>} Promise resolved with administration options for each course.
|
||||||
*/
|
*/
|
||||||
getUserAdministrationOptions(courseIds: number[], siteId?: string): Promise<any> {
|
getUserAdministrationOptions(courseIds: number[], siteId?: string): Promise<any> {
|
||||||
|
if (!courseIds || courseIds.length == 0) {
|
||||||
|
return Promise.resolve({});
|
||||||
|
}
|
||||||
|
|
||||||
return this.sitesProvider.getSite(siteId).then((site) => {
|
return this.sitesProvider.getSite(siteId).then((site) => {
|
||||||
const params = {
|
const params = {
|
||||||
courseids: courseIds
|
courseids: courseIds
|
||||||
|
@ -597,6 +601,10 @@ export class CoreCoursesProvider {
|
||||||
* @return {Promise<any>} Promise resolved with navigation options for each course.
|
* @return {Promise<any>} Promise resolved with navigation options for each course.
|
||||||
*/
|
*/
|
||||||
getUserNavigationOptions(courseIds: number[], siteId?: string): Promise<any> {
|
getUserNavigationOptions(courseIds: number[], siteId?: string): Promise<any> {
|
||||||
|
if (!courseIds || courseIds.length == 0) {
|
||||||
|
return Promise.resolve({});
|
||||||
|
}
|
||||||
|
|
||||||
return this.sitesProvider.getSite(siteId).then((site) => {
|
return this.sitesProvider.getSite(siteId).then((site) => {
|
||||||
const params = {
|
const params = {
|
||||||
courseids: courseIds
|
courseids: courseIds
|
||||||
|
|
Loading…
Reference in New Issue