Class: InfinumId::Api::WebhooksController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- InfinumId::Api::WebhooksController
- Defined in:
- app/controllers/infinum_id/api/webhooks_controller.rb
Instance Method Summary collapse
Instance Method Details
#create_resource_callback ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/controllers/infinum_id/api/webhooks_controller.rb', line 13 def create_resource_callback return render_already_exists if resource resource = resource_class.create(user_params.merge(provider: params[:provider])) InfinumId::AfterResourceCreate.call(resource, params[:user]) render json: { resource_name.underscore => 'created' } end |
#update_resource_callback ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'app/controllers/infinum_id/api/webhooks_controller.rb', line 4 def update_resource_callback return render_not_found unless resource resource.update(user_params) InfinumId::AfterResourceUpdate.call(resource, params[:user]) render json: { resource_name.underscore => 'updated' } end |