preview comments

This commit is contained in:
Andras Bacsai
2023-06-13 15:01:11 +02:00
parent cafe9019c1
commit 8dbe3cfe0c
14 changed files with 157 additions and 23 deletions

View File

@@ -38,7 +38,7 @@ class Previews extends Component
public function load_prs()
{
try {
['rate_limit_remaining' => $rate_limit_remaining, 'data' => $data] = get_from_git_api($this->application->source, "/repos/{$this->application->git_repository}/pulls");
['rate_limit_remaining' => $rate_limit_remaining, 'data' => $data] = git_api(source: $this->application->source, endpoint: "/repos/{$this->application->git_repository}/pulls");
$this->rate_limit_remaining = $rate_limit_remaining;
$this->pull_requests = $data->sortBy('number')->values();
} catch (\Throwable $e) {

View File

@@ -66,7 +66,7 @@ class PublicGitRepository extends Component
$this->get_git_source();
try {
['data' => $data] = get_from_git_api($this->git_source, "/repos/{$this->git_repository}/branches");
['data' => $data] = git_api(source: $this->git_source, endpoint: "/repos/{$this->git_repository}/branches");
$this->branches = collect($data)->pluck('name')->toArray();
} catch (\Throwable $e) {
return general_error_handler(err: $e, that: $this);