feat: Execute macro actions, for the conversation (#5066)

This commit is contained in:
Tejaswini Chile
2022-07-26 12:41:22 +05:30
committed by GitHub
parent bd7a56061e
commit 6a4c0a1578
17 changed files with 232 additions and 89 deletions

View File

@@ -1,6 +1,6 @@
class Api::V1::Accounts::MacrosController < Api::V1::Accounts::BaseController
before_action :check_authorization
before_action :fetch_macro, only: [:show, :update, :destroy]
before_action :fetch_macro, only: [:show, :update, :destroy, :execute]
def index
@macros = Macro.with_visibility(current_user, params)
@@ -34,6 +34,12 @@ class Api::V1::Accounts::MacrosController < Api::V1::Accounts::BaseController
end
end
def execute
::MacrosExecutionJob.perform_later(@macro, conversation_ids: params[:conversation_ids], user: Current.user)
head :ok
end
def permitted_params
params.permit(
:name, :account_id, :visibility,