discourse/plugins/automation/app/controllers/discourse_automation/automations_controller.rb
Osama Sayegh 3d4faf3272
FEATURE: Merge discourse-automation (#26432)
Automation (previously known as discourse-automation) is now a core plugin.
2024-04-03 18:20:43 +03:00

15 lines
434 B
Ruby

# frozen_string_literal: true
module DiscourseAutomation
class AutomationsController < ApplicationController
requires_plugin DiscourseAutomation::PLUGIN_NAME
before_action :ensure_admin
def trigger
automation = DiscourseAutomation::Automation.find(params[:id])
automation.trigger_in_background!(params.merge(kind: DiscourseAutomation::Triggers::API_CALL))
render json: success_json
end
end
end