From e5159689a86c250bd3dc87cac5c6d7963c07438c Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 18 Dec 2023 15:22:50 -0800 Subject: [PATCH] 201 to 204 --- app/controllers/collection_controller.rb | 2 +- app/controllers/owner_controller.rb | 2 +- spec/controllers/collection_controller_spec.rb | 2 +- spec/controllers/owner_controller_spec.rb | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/collection_controller.rb b/app/controllers/collection_controller.rb index 00809c2d2..ca8492861 100644 --- a/app/controllers/collection_controller.rb +++ b/app/controllers/collection_controller.rb @@ -61,7 +61,7 @@ def local_id_search @results = find_by_localid(collection_ark, params[:terms]) return render_object_info(@results[0].ark) if @results.length == 1 end - render status: 201, json: {}.to_json + render status: 204, json: {}.to_json end private diff --git a/app/controllers/owner_controller.rb b/app/controllers/owner_controller.rb index fd2824c7d..45236a533 100644 --- a/app/controllers/owner_controller.rb +++ b/app/controllers/owner_controller.rb @@ -41,7 +41,7 @@ def search_results @results = find_by_file_name(@request_owner, term) if @results.empty? @results = find_by_full_text(@request_owner, terms) if @results.empty? end - render status: @results.empty? ? 201 : 200 + render status: @results.empty? ? 204 : 200 end private diff --git a/spec/controllers/collection_controller_spec.rb b/spec/controllers/collection_controller_spec.rb index 1aef1e3b2..74049e6cd 100644 --- a/spec/controllers/collection_controller_spec.rb +++ b/spec/controllers/collection_controller_spec.rb @@ -68,7 +68,7 @@ mock_permissions_all(user_id, collection_id) request.session.merge!({ uid: user_id }) get(:local_id_search, params: { group: @collection.group, terms: 'my-local-id-not-found' }) - expect(response.status).to eq(201) + expect(response.status).to eq(204) end it 'localid search - result found' do diff --git a/spec/controllers/owner_controller_spec.rb b/spec/controllers/owner_controller_spec.rb index 73fac9ee4..d64330944 100644 --- a/spec/controllers/owner_controller_spec.rb +++ b/spec/controllers/owner_controller_spec.rb @@ -63,7 +63,7 @@ def mock_owner_name(name) mock_owner_name(@owner.name) request.session.merge!({ uid: user_id }) get(:search_results, params: { terms: 'my-local-id-not-found', owner: @owner.name }) - expect(response.status).to eq(201) + expect(response.status).to eq(204) end it 'empty terms search no results' do @@ -71,7 +71,7 @@ def mock_owner_name(name) mock_owner_name(@owner.name) request.session.merge!({ uid: user_id }) get(:search_results, params: { terms: '', owner: @owner.name }) - expect(response.status).to eq(201) + expect(response.status).to eq(204) end it 'localid search - result found' do