diff --git a/CHANGELOG.md b/CHANGELOG.md index b66391f9..2748d98b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## 0.11.1 - 2023-08-21 + +- additional condition to the filter parsing process - check not only of double but for single quotes as well + ## 0.11.0 - 2023-08-20 - **BREAKING** [#199](https://github.com/Informatiqal/qlik-saas-api/issues/199) introduction to common `getFilter` methods for majority of methods. For methods that already had `getFilter` this method is renamed to `getFilterNative`. The new `getFilter` methods is behaving similarly to the QSEoW Repository API filter endpoints where filters criteria can be passed as "readable" text eg. `name eq "something" and published ne true`. Methods that dont have the new `getFilter` will be evaluated in the next release diff --git a/package.json b/package.json index 405edcce..18c1ada4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qlik-saas-api", - "version": "0.11.0", + "version": "0.11.1", "description": "Interact with Qlik Sense SaaS REST API", "author": { "email": "info@informatiqal.com", diff --git a/src/util/filter.ts b/src/util/filter.ts index 02fcbdb2..15f54f18 100644 --- a/src/util/filter.ts +++ b/src/util/filter.ts @@ -16,9 +16,9 @@ export type ParsedCondition = { */ export function parseFilter( filter: string, - baseObjPath: string, + baseObjPath: string // data: {} -){ +) { // if (!filter) throw new Error(""); // split the conditions on "and" and "or" (ignore cases: AND = and = And etc.) @@ -92,10 +92,11 @@ function constructFilter( if ( isNaN(Number(c1.value)) && - (!c1.value.startsWith(`"`) || !c1.value.endsWith(`"`)) + (!c1.value.startsWith(`"`) || !c1.value.endsWith(`"`)) && + (!c1.value.startsWith(`'`) || !c1.value.endsWith(`'`)) ) throw new Error( - `Error while parsing filter value. The value is an instance of a string but its not surrounded by double-quotes. Provided value was: ${c1.value}` + `Error while parsing filter value. The value is an instance of a string but its not surrounded by double/single-quotes. Provided value was: ${c1.value}` ); return `${baseObjPath}.${c[c1.operation](c1.property, c1.value)} ${