diff options
Diffstat (limited to 'client/src/app/core/rest/rest.service.ts')
-rw-r--r-- | client/src/app/core/rest/rest.service.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/src/app/core/rest/rest.service.ts b/client/src/app/core/rest/rest.service.ts index 78558851a..c12b6bd41 100644 --- a/client/src/app/core/rest/rest.service.ts +++ b/client/src/app/core/rest/rest.service.ts | |||
@@ -68,8 +68,9 @@ export class RestService { | |||
68 | parseQueryStringFilter (q: string, prefixes: QueryStringFilterPrefixes): ParseQueryStringFilterResult { | 68 | parseQueryStringFilter (q: string, prefixes: QueryStringFilterPrefixes): ParseQueryStringFilterResult { |
69 | if (!q) return {} | 69 | if (!q) return {} |
70 | 70 | ||
71 | // Tokenize the strings using spaces | 71 | // Tokenize the strings using spaces that are not in quotes |
72 | const tokens = q.split(' ').filter(token => !!token) | 72 | const tokens = q.match(/(?:[^\s"]+|"[^"]*")+/g) |
73 | .filter(token => !!token) | ||
73 | 74 | ||
74 | // Build prefix array | 75 | // Build prefix array |
75 | const prefixeStrings = Object.values(prefixes) | 76 | const prefixeStrings = Object.values(prefixes) |
@@ -88,6 +89,7 @@ export class RestService { | |||
88 | 89 | ||
89 | const matchedTokens = tokens.filter(t => t.startsWith(prefix)) | 90 | const matchedTokens = tokens.filter(t => t.startsWith(prefix)) |
90 | .map(t => t.slice(prefix.length)) // Keep the value filter | 91 | .map(t => t.slice(prefix.length)) // Keep the value filter |
92 | .map(t => t.replace(/^"|"$/g, '')) | ||
91 | .map(t => { | 93 | .map(t => { |
92 | if (prefixObj.handler) return prefixObj.handler(t) | 94 | if (prefixObj.handler) return prefixObj.handler(t) |
93 | 95 | ||