diff --git a/app/controllers/alma_item_set_controller.rb b/app/controllers/alma_item_set_controller.rb index 33c4fb10..4eba2ddf 100644 --- a/app/controllers/alma_item_set_controller.rb +++ b/app/controllers/alma_item_set_controller.rb @@ -1,6 +1,7 @@ require 'date' class AlmaItemSetController < ApplicationController + VALID_ENVS = %w[production sandbox].freeze # TODO: - Need to make sure only certain staff access this page before_action :authorize! @@ -14,7 +15,9 @@ def index # rubocop:disable Metrics/AbcSize def update env = params[:alma_env] - alma_set_id = params[:alma_set_id] + return head(:bad_request) unless env.in? VALID_ENVS + + alma_set_id = params[:"alma_set_id_#{env}"] num = params[:note_num] note = new_note(params[:note_value], params[:initials]) diff --git a/app/views/alma_item_set/index.html.erb b/app/views/alma_item_set/index.html.erb index 16b24144..21513f63 100644 --- a/app/views/alma_item_set/index.html.erb +++ b/app/views/alma_item_set/index.html.erb @@ -17,13 +17,21 @@ <%= f.label("#{rb_alma_env}_sandbox".to_sym, "Sandbox") %> <%# Set Name %> -