Skip to content

Commit

Permalink
Simplify index action
Browse files Browse the repository at this point in the history
No need to put 2 lines into an extra method.

Also: projectlist, packagelist and filelist are no actions. Only index is an
action...
  • Loading branch information
hennevogel committed Dec 20, 2023
1 parent 7bccca7 commit e4fb2c6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/api/app/controllers/source_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ class SourceController < ApplicationController
'waitservice', 'getprojectservices', 'unlock', 'wipe', 'rebuild', 'collectbuildenv'].freeze

validate_action index: { method: :get, response: :directory }
validate_action projectlist: { method: :get, response: :directory }
validate_action packagelist: { method: :get, response: :directory }
validate_action filelist: { method: :get, response: :directory }

skip_before_action :extract_user, only: [:lastevents_public, :global_command_orderkiwirepos, :global_command_triggerscmsync]
skip_before_action :require_login, only: [:lastevents_public, :global_command_orderkiwirepos, :global_command_triggerscmsync]
Expand Down Expand Up @@ -49,15 +46,11 @@ def index

pass_to_backend
else
projectlist
@project_names = Project.order(:name).pluck(:name)
render formats: [:xml]
end
end

def projectlist
@project_names = Project.order(:name).pluck(:name)
render formats: [:xml]
end

def set_issues_default
@filter_changes = @states = nil
@filter_changes = params[:changes].split(',') if params[:changes]
Expand Down

0 comments on commit e4fb2c6

Please sign in to comment.