From 11e5a29ba16c7968d59ecf653033d5b67f651ab9 Mon Sep 17 00:00:00 2001 From: torky <24torky@gmail.com> Date: Sun, 11 May 2025 18:55:32 +0300 Subject: [PATCH 1/2] Add optional allowCache to IGetListsOptions and utilize in GetLists --- src/utils/sharepoint.rest/web.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/sharepoint.rest/web.ts b/src/utils/sharepoint.rest/web.ts index 853ef72..af76c54 100644 --- a/src/utils/sharepoint.rest/web.ts +++ b/src/utils/sharepoint.rest/web.ts @@ -293,6 +293,7 @@ export function GetContentTypesSync(siteUrl: string, options: IGetContentTypesOp interface IGetListsOptions { includeRootFolders?: boolean; includeViews?: boolean; + allowCache?: boolean; } function _getListsRequestUrl(siteUrl: string, options: IGetListsOptions) { @@ -335,8 +336,8 @@ function _postProcessGetLists(lists: iList[], options: Omit { let url = _getListsRequestUrl(siteUrl, options); - - return GetJson<{ value: iList[]; }>(url, null, { allowCache: true, jsonMetadata: jsonTypes.nometadata }) + const allowCache = options.allowCache === undefined ? true : false; + return GetJson<{ value: iList[]; }>(url, null, { allowCache, jsonMetadata: jsonTypes.nometadata }) .then(result => { return _postProcessGetLists(result.value, options); }) From 34279aaedbba5d58c1a4ea3a02efdad749dba36e Mon Sep 17 00:00:00 2001 From: torky <24torky@gmail.com> Date: Sun, 11 May 2025 19:01:54 +0300 Subject: [PATCH 2/2] Adjust value passed --- src/utils/sharepoint.rest/web.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/sharepoint.rest/web.ts b/src/utils/sharepoint.rest/web.ts index af76c54..e37b7aa 100644 --- a/src/utils/sharepoint.rest/web.ts +++ b/src/utils/sharepoint.rest/web.ts @@ -336,7 +336,7 @@ function _postProcessGetLists(lists: iList[], options: Omit { let url = _getListsRequestUrl(siteUrl, options); - const allowCache = options.allowCache === undefined ? true : false; + const allowCache = options.allowCache === undefined ? true : options.allowCache; return GetJson<{ value: iList[]; }>(url, null, { allowCache, jsonMetadata: jsonTypes.nometadata }) .then(result => { return _postProcessGetLists(result.value, options);