mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
api(application): fix database requests returning 404
This commit is contained in:
@@ -25,8 +25,8 @@ class DeleteDatabaseRequest extends ApplicationApiRequest
|
||||
*/
|
||||
public function resourceExists(): bool
|
||||
{
|
||||
$database = $this->route()->parameter('database');
|
||||
$databaseHost = $this->route()->parameter('databaseHost');
|
||||
|
||||
return $database instanceof DatabaseHost && $database->exists;
|
||||
return $databaseHost instanceof DatabaseHost && $databaseHost->exists;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ class GetDatabaseRequest extends GetDatabasesRequest
|
||||
*/
|
||||
public function resourceExists(): bool
|
||||
{
|
||||
$database = $this->route()->parameter('database');
|
||||
$databaseHost = $this->route()->parameter('databaseHost');
|
||||
|
||||
return $database instanceof DatabaseHost && $database->exists;
|
||||
return $databaseHost instanceof DatabaseHost && $databaseHost->exists;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ class UpdateDatabaseRequest extends StoreDatabaseRequest
|
||||
*/
|
||||
public function rules(array $rules = null): array
|
||||
{
|
||||
return $rules ?? DatabaseHost::getRulesForUpdate($this->route()->parameter('database')->id);
|
||||
return $rules ?? DatabaseHost::getRulesForUpdate($this->route()->parameter('databaseHost')->id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user