Merge pull request #10193 from appwrite/fix-stuff

Fix: route didn't include the params needed
This commit is contained in:
Jake Barnby 2025-07-23 21:57:31 +12:00 committed by GitHub
commit 722c1ddf99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -854,7 +854,7 @@ App::init()
} }
if (version_compare($requestFormat, '1.8.0', '<')) { if (version_compare($requestFormat, '1.8.0', '<')) {
$dbForProject = $getProjectDB($project); $dbForProject = $getProjectDB($project);
$request->addFilter(new RequestV20($dbForProject, $route)); $request->addFilter(new RequestV20($dbForProject, $request->getParams()));
} }
} }

View file

@ -7,12 +7,12 @@ use Utopia\Route;
abstract class Filter abstract class Filter
{ {
private ?Route $route; private array $params;
private ?Database $dbForProject; private ?Database $dbForProject;
public function __construct(Database $dbForProject = null, Route $route = null) public function __construct(Database $dbForProject = null, array $params = [])
{ {
$this->route = $route; $this->params = $params;
$this->dbForProject = $dbForProject; $this->dbForProject = $dbForProject;
} }
@ -47,7 +47,7 @@ abstract class Filter
public function getParamValue(string $key, mixed $default = ''): mixed public function getParamValue(string $key, mixed $default = ''): mixed
{ {
try { try {
$value = $this->route?->getParamValue($key) ?? $default; $value = $this->params[$key] ?? $default;
} catch (\Exception $e) { } catch (\Exception $e) {
$value = $default; $value = $default;
} }