Class: Blocks::Sdk::Rails::Controllers::TranslationsWebhooksController

Inherits:
ActionController::API
  • Object
show all
Defined in:
lib/blocks/sdk/rails/controllers/translations_webhooks_controller.rb

Overview

Webhook controller specifically for Translations service Other services should implement their own webhook controllers

Instance Method Summary collapse

Instance Method Details

#createObject

POST /blocks/webhooks/translations Handles webhook callbacks for translations cache invalidation



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/blocks/sdk/rails/controllers/translations_webhooks_controller.rb', line 13

def create
  result = @service_manager.handle_webhook(
    service_name: "translations",
    payload: webhook_params,
    config: client_config
  )

  if result[:success]
    render json: result, status: :ok
  else
    render json: result, status: :unprocessable_entity
  end
end