Skip to content

Commit

Permalink
Merge pull request #8 from abenerd/feature/simplify-url-generation
Browse files Browse the repository at this point in the history
Simplify url generation for flare error count check
  • Loading branch information
freekmurze authored Dec 7, 2021
2 parents f752148 + ea1ecb5 commit 3c83e43
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Checks/Checks/FlareErrorOccurrenceCountCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ protected function getFlareErrorOccurrenceCount(): int
$startDate = urlencode(now()->subMinutes($this->periodInMinutes)->utc()->format('Y-m-d H:i:s'));
$endDate = urlencode(now()->utc()->format('Y-m-d H:i:s'));

$url = "https://flareapp.io/api/projects/{$this->flareProjectId}/error-occurrence-count?start_date={$startDate}&end_date={$endDate}&api_token={$this->flareApiToken}";

return Http::acceptJson()->get($url)
->json('count', 0);
return Http::acceptJson()
->get("https://flareapp.io/api/projects/{$this->flareProjectId}/error-occurrence-count", [
'start_date' => $startDate,
'end_date' => $endDate,
'api_token' => $this->flareApiToken,
])->json('count', 0);
}

public function getLabel(): string
Expand Down

0 comments on commit 3c83e43

Please sign in to comment.