fix: system-wide GitHub apps (#5114)
- fix(ui): system-wide GitHub Apps are not shown in the create a new Application dialog - fix: query logic error that shows all system-wide apps, regardless of whether they are public or private. - fix: clicking on a system-wide GitHub app from a team other than the one that created it resulted in a 404 error.
This commit is contained in:
@@ -248,15 +248,17 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, Sen
|
||||
{
|
||||
$sources = collect([]);
|
||||
$github_apps = GithubApp::where(function ($query) {
|
||||
$query->where('team_id', $this->id)
|
||||
->Where('is_public', false)
|
||||
->orWhere('is_system_wide', true);
|
||||
$query->where(function ($q) {
|
||||
$q->where('team_id', $this->id)
|
||||
->orWhere('is_system_wide', true);
|
||||
})->where('is_public', false);
|
||||
})->get();
|
||||
|
||||
$gitlab_apps = GitlabApp::where(function ($query) {
|
||||
$query->where('team_id', $this->id)
|
||||
->Where('is_public', false)
|
||||
->orWhere('is_system_wide', true);
|
||||
$query->where(function ($q) {
|
||||
$q->where('team_id', $this->id)
|
||||
->orWhere('is_system_wide', true);
|
||||
})->where('is_public', false);
|
||||
})->get();
|
||||
|
||||
return $sources->merge($github_apps)->merge($gitlab_apps);
|
||||
|
||||
Reference in New Issue
Block a user