1
0
Fork 0
mirror of synced 2024-06-18 18:54:55 +12:00

Fixed TODOs

This commit is contained in:
Matej Baco 2022-01-04 10:05:21 +01:00
parent df97b67c6d
commit df9e064047
2 changed files with 5 additions and 8 deletions

View file

@ -47,7 +47,6 @@ App::init(function ($utopia, $request, $response, $console, $project, $dbForCons
$requestFormat = $request->getHeader('x-appwrite-response-format', App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', ''));
if ($requestFormat) {
switch($requestFormat) {
// TODO: For some reason console is still on 0.11. We dont want this filter logic in console, console uses 0.12 SDK
case version_compare ($requestFormat , '0.11.0', '<=') :
Request::setFilter(new V12());
break;

View file

@ -134,18 +134,16 @@ class V12 extends Filter
if(isset($usedOperator)) {
[ $attributeKey, $filterValue ] = \explode($usedOperator, $filter);
// TODO: String or not? Any way to figure out?
$query = $attributeKey . '.' . $operators[$usedOperator] . '("' . $filterValue . '")';
$filterValue = \is_numeric($filterValue) ? $filterValue : '"' . $filterValue . '"';
$query = $attributeKey . '.' . $operators[$usedOperator] . '(' . $filterValue . ')';
\array_push($queries, $query);
}
}
}
// TODO: Can we even migrate search? Which key? Is $id key OK?
// TODO: What's difference between !empty and isset?
if(!empty($content['search'])) {
\array_push($queries, '$id.search("' . $content['search'] . '")');
}
// We cannot migrate search properly
unset($content['search']);
unset($content['filters']);
unset($content['search']);