Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalchevrel committed Sep 30, 2024
1 parent 5ff4dd1 commit 9bfdc21
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions app/controllers/api/nightly.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit 9bfdc21

Please sign in to comment.