From b3b191b6d4d968964d28688d53af78d7ae87fab7 Mon Sep 17 00:00:00 2001 From: Priyanka Date: Thu, 9 Nov 2023 22:05:34 +0530 Subject: [PATCH] UIU-2955 - add a header comment to escapeSpecialCharactersInTagFilters function --- src/routes/UserSearchContainer.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/routes/UserSearchContainer.js b/src/routes/UserSearchContainer.js index 6a6d6901c..2019a33e4 100644 --- a/src/routes/UserSearchContainer.js +++ b/src/routes/UserSearchContainer.js @@ -35,6 +35,15 @@ const searchFields = [ ]; const compileQuery = template(`(${searchFields.join(' or ')})`, { interpolate: /%{([\s\S]+?)}/g }); +/* + Some of the special characters that are allowed while creating a tag are "", \, *, ? + These special characters cause CQL exceptions while searching the user records, which are + assigned with such tags. + This function "escapeSpecialCharactersInTagFilters" intends to escape the special characters + in filters of type "Tags" + Ref: https://issues.folio.org/browse/UIU-2995 +*/ + const escapeSpecialCharactersInTagFilters = (queryParams, resourceData) => { const newResourceData = cloneDeep(resourceData); let escapedFilters;