fix: route didn't include the params needed.

This commit is contained in:
Darshan 2025-07-23 15:10:27 +05:30
parent 201c18051f
commit 8ac0486e73
2 changed files with 5 additions and 5 deletions

View file

@ -854,7 +854,7 @@ App::init()
}
if (version_compare($requestFormat, '1.8.0', '<')) {
$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
{
private ?Route $route;
private array $params;
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;
}
@ -47,7 +47,7 @@ abstract class Filter
public function getParamValue(string $key, mixed $default = ''): mixed
{
try {
$value = $this->route?->getParamValue($key) ?? $default;
$value = $this->params[$key] ?? $default;
} catch (\Exception $e) {
$value = $default;
}