Create error_blueprint.rb

This commit is contained in:
Justin Edmund 2022-12-21 01:20:55 -08:00
parent 31e62e073c
commit a1ff18092d

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
module Api
module V1
class ErrorBlueprint < Blueprinter::Base
field :error, if: ->(_field_name, _error, options) { options.key?(:error) } do |_, options|
options[:error]
end
field :errors, if: ->(_field_name, _error, options) { options.key?(:errors) } do |_, options|
options[:errors]
end
end
end
end