From 718882a7caf2de8ca421be2b33a3dbfaa65fbe98 Mon Sep 17 00:00:00 2001 From: Ben Pennell Date: Mon, 13 Nov 2023 09:17:21 -0500 Subject: [PATCH] Add render_json_response method from included class which does not appear to be available --- app/controllers/application_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0fa00cb84..c2b074bc3 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -38,6 +38,11 @@ def render_riiif_404 render_json_response(response_type: :not_found) end + def render_json_response(response_type: :success, message: nil, options: {}) + json_body = Hyrax::API.generate_response_body(response_type: response_type, message: message, options: options) + render json: json_body, status: response_type + end + def render_404 render 'errors/not_found', status: 404 end