Merge pull request #4814 from peaklabs-dev/fix-system-wide-gh-apps
fix: instance wide GitHub apps
This commit is contained in:
commit
bc42429f7e
1 changed files with 11 additions and 2 deletions
|
|
@ -247,8 +247,17 @@ public function privateKeys()
|
|||
public function sources()
|
||||
{
|
||||
$sources = collect([]);
|
||||
$github_apps = $this->hasMany(GithubApp::class)->whereisPublic(false)->get();
|
||||
$gitlab_apps = $this->hasMany(GitlabApp::class)->whereisPublic(false)->get();
|
||||
$github_apps = GithubApp::where(function ($query) {
|
||||
$query->where('team_id', $this->id)
|
||||
->Where('is_public', false)
|
||||
->orWhere('is_system_wide', true);
|
||||
})->get();
|
||||
|
||||
$gitlab_apps = GitlabApp::where(function ($query) {
|
||||
$query->where('team_id', $this->id)
|
||||
->Where('is_public', false)
|
||||
->orWhere('is_system_wide', true);
|
||||
})->get();
|
||||
|
||||
return $sources->merge($github_apps)->merge($gitlab_apps);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue