Class: InfinumAzure::Api::WebhooksController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- InfinumAzure::ApplicationController
- BaseController
- InfinumAzure::Api::WebhooksController
- Defined in:
- app/controllers/infinum_azure/api/webhooks_controller.rb
Instance Method Summary collapse
Methods inherited from InfinumAzure::ApplicationController
Instance Method Details
#upsert_resource_callback ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/infinum_azure/api/webhooks_controller.rb', line 6 def upsert_resource_callback if resource resource.update(user_params) action = 'updated' else @resource = resource_class.create(user_params) action = 'created' end InfinumAzure::AfterUpsertResource.call(resource, normalized_azure_params) render json: { resource_name.underscore => action } end |