diff --git a/app/controllers/api/nightly.php b/app/controllers/api/nightly.php index 3b239e6..fd8ab6f 100644 --- a/app/controllers/api/nightly.php +++ b/app/controllers/api/nightly.php @@ -4,15 +4,10 @@ use ReleaseInsights\{Json, Model}; -$data = (new Model('api_nightly'))->get(); - - - -// We want to send a simplified Json for our public API -$data_for_api = []; -foreach ($data as $key => $values) { - $data_for_api[$key] = $values['revision']; +// We want to send simplified Json data for our public API +$data = []; +foreach ((new Model('api_nightly'))->get() as $key => $values) { + $data[$key] = $values['revision']; } -\ReleaseInsights\Debug::dump($data, $data_for_api); -(new Json($data_for_api))->render(); +(new Json($data))->render(); \ No newline at end of file