wedding-planner/app/controllers/users/confirmations_controller.rb

20 lines
458 B
Ruby
Raw Normal View History

2024-11-30 17:47:30 +00:00
# Copyright (C) 2024 Manuel Bustillo
2024-11-30 18:46:25 +01:00
class Users::ConfirmationsController < Devise::ConfirmationsController
clear_respond_to
respond_to :json
def show
super do |resource|
if resource.errors.empty?
render json: resource, status: :ok
else
render json: {
message: 'Record invalid',
errors: resource.errors.full_messages
}, status: :unprocessable_entity
end
return
end
end
end