diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index eff18d88..b2a264ce 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -303,7 +303,7 @@ class CatalogController < ApplicationController config.add_summary_field "language", field: "language_ssim" config.add_summary_field "prefercite", field: "prefercite_html_tesm", helper_method: :render_html_tags config.add_summary_field "availability", field: "availability_status", accessor: :availability_status - config.add_summary_field "accessconditions", field: "access_conditions", accessor: :access_conditions + config.add_summary_field "accessconditions", field: "access_conditions_ssim" config.add_summary_field "cult_sens_adv_notice", label: I18n.t("ead_notes.cultural_sens_adv_notice"), helper_method: :render_html_tags, diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index c62d9302..6eb7f971 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -118,10 +118,4 @@ def availability_status CatalogueServicesClient.new.get_requestable(instance_id: self["folio_instance_id_ssi"], holdings_id: holdings, item_id: item) end - - def access_conditions - holdings, _item = CatalogueServicesClient.new.get_item_ids(instance_id: self["folio_instance_id_ssi"]) - - CatalogueServicesClient.new.get_access_conditions(instance_id: self["folio_instance_id_ssi"], holdings_id: holdings) - end end diff --git a/app/services/catalogue_services_client.rb b/app/services/catalogue_services_client.rb index f39708da..ebf17b9c 100644 --- a/app/services/catalogue_services_client.rb +++ b/app/services/catalogue_services_client.rb @@ -64,18 +64,6 @@ def get_item_ids(instance_id:) [item_id, holding_id] end - def get_access_conditions(instance_id:, holdings_id:) - all_holdings = get_holdings(instance_id: instance_id) - - # find holdings record - holding = all_holdings.find { |h| h["id"] == holdings_id } - - # find item record - item = holding["notes"].find { |i| i["holdingsNoteType"] == "Restriction" } - - item ? item["note"] : nil - end - def related_docs(pid:) conn = setup_connection diff --git a/spec/services/catalogue_services_client_spec.rb b/spec/services/catalogue_services_client_spec.rb index 11e58e77..b91410cb 100644 --- a/spec/services/catalogue_services_client_spec.rb +++ b/spec/services/catalogue_services_client_spec.rb @@ -42,22 +42,6 @@ end end - describe "#get_access_conditions" do - before do - cat_response = IO.read("spec/files/catalogue_services/08aed703-3648-54d0-80ef-fddb3c635731.json") - WebMock.stub_request(:get, /catservices.test\/catalogue-services\/folio\/instance\/08aed703-3648-54d0-80ef-fddb3c635731/) - .to_return(status: 200, body: cat_response, headers: {"Content-Type" => "application/json"}) - end - - it "returns the record's item id and holding id" do - expect(service.get_item_ids(instance_id: "08aed703-3648-54d0-80ef-fddb3c635731")).to eq %w[d6c97d9e-dfe6-5faa-9f0b-020b2bddbf8c 7460acfb-72b9-5dba-9089-603921fb47c7] - end - - it "returns the record's access condition notes or nil" do - expect(service.get_access_conditions(instance_id: "08aed703-3648-54d0-80ef-fddb3c635731", holdings_id: "d6c97d9e-dfe6-5faa-9f0b-020b2bddbf8c")).to be_nil - end - end - describe "#related_docs" do context "when there are related records" do before do