mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 11:53:31 +08:00
16 lines
442 B
Ruby
Vendored
16 lines
442 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module DiscourseAutomation
|
|
class AutomationsController < ApplicationController
|
|
requires_plugin PLUGIN_NAME
|
|
before_action :ensure_admin
|
|
|
|
def trigger
|
|
automation = DiscourseAutomation::Automation.find(params[:id])
|
|
automation.trigger_in_background!(
|
|
params.to_unsafe_h.merge(kind: DiscourseAutomation::Triggers::API_CALL),
|
|
)
|
|
render json: success_json
|
|
end
|
|
end
|
|
end
|