mirror of
https://github.com/discourse/discourse.git
synced 2024-12-27 00:53:47 +08:00
15 lines
434 B
Ruby
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
|