diff --git a/web/API/stations.php b/web/API/stations.php index 74ee8cb..185eb25 100644 --- a/web/API/stations.php +++ b/web/API/stations.php @@ -3,9 +3,20 @@ function APIinfo($params) { - $station = new \DAL\station() + $station = new \DAL\station(); - $station->find("apiKey", $params["key"]) + $station->find("apiKey", $params["key"]); return ["id" => $station->id->get(), "name" => $station->name->get(), "locator" => $station->locator->get()]; + } + + function keys($params) { + $stations = new \wsos\database\core\table(\DAL\station::class); + + $res = []; + foreach ($stations->getAll()->values as $station) { + $res[] = ["name" => $station->name->get(), "key" => $station->apiKey->get()]; + } + + return $res; } \ No newline at end of file