Skip to content

Commit

Permalink
Refactored / route handler
Browse files Browse the repository at this point in the history
  • Loading branch information
johntopleyons committed Sep 6, 2024
1 parent 280c64a commit c4e9801
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions webapp/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,23 @@

get '/?' do
begin
github = GitHub.new(CONFIG.github_enterprise, @selected_organisation,
CONFIG.github_api_base_uri, CONFIG.github_token)

organisation = github.organisation.data
organisation = @github.organisation
rescue GitHubError => e
return erb :github_error, locals: { title: 'GitHub Explorer', message: e.message, type: e.type }
end

pagy, owners = pagy_array(@firestore.all_owners)
archived_repositories_count, template_repositories_count = @firestore.archived_template_repositories_count
organisation.archived_repositories_count = archived_repositories_count
organisation.template_repositories_count = template_repositories_count

organisation.owners = @firestore.all_owners
pagy, owners = pagy_array(organisation.owners)
two_factor_disabled_count = @firestore.all_two_factor_disabled.count

erb :index, locals: { title: "#{@selected_organisation} - GitHub Explorer",
enterprise:,
organisation:,
owners:,
archived_repositories_count:,
template_repositories_count:,
two_factor_disabled_count:,
pagy: }
end
Expand Down

0 comments on commit c4e9801

Please sign in to comment.