1
0
Fork 0
mirror of synced 2024-04-29 18:32:40 +12:00

Merge pull request #2573 from appwrite/fix-request-filters

Fixed boolean request filters on listDocuments
This commit is contained in:
Torsten Dittmann 2022-01-07 13:53:52 +01:00 committed by GitHub
commit 55c9d819d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,7 +141,13 @@ class V12 extends Filter
if(isset($usedOperator)) {
[ $attributeKey, $filterValue ] = \explode($usedOperator, $filter);
$filterValue = \is_numeric($filterValue) ? $filterValue : '"' . $filterValue . '"';
if($filterValue === 'true' || $filterValue === 'false') {
// Let's keep it at true and false string, but without "" around
// No action needed
} else {
$filterValue = \is_numeric($filterValue) ? $filterValue : '"' . $filterValue . '"';
}
$query = $attributeKey . '.' . $operators[$usedOperator] . '(' . $filterValue . ')';
\array_push($queries, $query);
}
@ -152,7 +158,6 @@ class V12 extends Filter
unset($content['search']);
unset($content['filters']);
unset($content['search']);
$content['queries'] = $queries;
return $content;