Skip to content

Commit

Permalink
Merge pull request #3090 from alphagov/remove-redundant-code
Browse files Browse the repository at this point in the history
Remove redundant RootController code
  • Loading branch information
yndajas authored Aug 13, 2024
2 parents 44519de + 060c868 commit 4489004
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions app/controllers/root_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ class RootController < ApplicationController
skip_after_action :verify_authorized

def index
applications = Doorkeeper::Application.not_api_only.with_home_uri.can_signin(current_user)

@applications_and_permissions = applications.map do |application|
[application, current_user.application_permissions.where(application_id: application.id)]
end
@applications = Doorkeeper::Application.not_api_only.with_home_uri.can_signin(current_user)
end

def signin_required
Expand Down
4 changes: 2 additions & 2 deletions app/views/root/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
} %>
<% end %>
<% if @applications_and_permissions.empty? %>
<% if @applications.empty? %>
<p class="govuk-body">
You haven’t been assigned to any applications yet
</p>
<% end %>
<% @applications_and_permissions.each do |application, permissions| %>
<% @applications.each do |application| %>
<div class="app-application-list__item">
<h3 class="govuk-heading-m govuk-!-margin-bottom-1">
<%= link_to application.name, application.home_uri, class: "govuk-link" %>
Expand Down

0 comments on commit 4489004

Please sign in to comment.