From 412560924e3ee966994527e31e22b45f99c5bedc Mon Sep 17 00:00:00 2001 From: wilecoyotegenius Date: Tue, 1 Oct 2024 23:58:24 +0200 Subject: [PATCH] #1870 fix --- src/services/SPService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/SPService.ts b/src/services/SPService.ts index 1887d539b..c6f72f2b3 100644 --- a/src/services/SPService.ts +++ b/src/services/SPService.ts @@ -240,7 +240,12 @@ export default class SPService implements ISPService { orderByStr = ``; } - const camlQuery = `${substringSearch ? '' : ''}${filterText}${substringSearch ? '' : ''}${orderByStr}`; + let filterPart = "" + if (filterText) { + filterPart = `${substringSearch ? '' : ''}${filterText}${substringSearch ? '' : ''}` + } + + const camlQuery = `${filterPart}${orderByStr}`; apiUrl = `${webAbsoluteUrl}/_api/web/lists('${listId}')/GetItems(query=@v1)?$select=${keyInternalColumnName || 'Id'},${internalColumnName}&@v1=${JSON.stringify({ ViewXml: camlQuery })}`; isPost = true;