From 4de10e2d9f1fe8ef029eb2f32e1c9cb8be38a90c Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 26 Oct 2020 09:20:34 +0100 Subject: [PATCH] MOBILE-3523 mod: Fix cannot get siteId of undefined --- src/addon/mod/data/providers/data.ts | 2 +- src/addon/mod/folder/providers/folder.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/addon/mod/data/providers/data.ts b/src/addon/mod/data/providers/data.ts index cde86d294..0c4d01e23 100644 --- a/src/addon/mod/data/providers/data.ts +++ b/src/addon/mod/data/providers/data.ts @@ -947,7 +947,7 @@ export class AddonModDataProvider { * @param options Other options. * @return Promise resolved when the action is done. */ - searchEntries(dataId: number, options?: AddonModDataSearchEntriesOptions): Promise { + searchEntries(dataId: number, options: AddonModDataSearchEntriesOptions = {}): Promise { options.groupId = options.groupId || 0; options.sort = options.sort || 0; options.order || options.order || 'DESC'; diff --git a/src/addon/mod/folder/providers/folder.ts b/src/addon/mod/folder/providers/folder.ts index a75520c16..af356293f 100644 --- a/src/addon/mod/folder/providers/folder.ts +++ b/src/addon/mod/folder/providers/folder.ts @@ -57,7 +57,7 @@ export class AddonModFolderProvider { * @param options Other options. * @return Promise resolved when the book is retrieved. */ - protected getFolderByKey(courseId: number, key: string, value: any, options?: CoreSitesCommonWSOptions) + protected getFolderByKey(courseId: number, key: string, value: any, options: CoreSitesCommonWSOptions = {}) : Promise { return this.sitesProvider.getSite(options.siteId).then((site) => { const params = {