Skip to content

Commit

Permalink
fix: null to list deployments for counting when there are none
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed May 1, 2024
1 parent 7941028 commit f52b6e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Upgrades MariaDB from `10.11` to `11.1.3`
- Swaps colored text statuses to easily-understood emoji and ensures statuses come as the first element in tables for easier readability
- Fixes a bug that returned `null` instead of an empty list when there were no deployments for a project leading to the inability to do counts on null

## v1.0.0 (2023-09-01)

Expand Down
4 changes: 2 additions & 2 deletions src/app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public function showProject(Request $request, string $project): View
$projectResponse = $this->harveyGetRequest(
"$this->harveyDomainProtocol://$this->harveyDomain/deployments?project=$project&page_size=$this->harveyPageSize" // phpcs:ignore
);
$deployments = $projectResponse->successful() ? $projectResponse->json()['deployments'] : null;
$deployments = $projectResponse->successful() ? $projectResponse->json()['deployments'] : [];
$deploymentsCount = $projectResponse->successful() ? $projectResponse->json()['total_count'] : 0;
} catch (Throwable $error) {
$deployments = null;
$deployments = [];
$deploymentsCount = 0;
}

Expand Down

0 comments on commit f52b6e1

Please sign in to comment.