add template webhooks

This commit is contained in:
Pete Matsyburka
2024-05-12 11:37:33 +03:00
parent 6f7128a51c
commit 929d29576d
7 changed files with 92 additions and 0 deletions
+4
View File
@@ -61,6 +61,8 @@ class TemplatesController < ApplicationController
if @template.save
Templates::CloneAttachments.call(template: @template, original_template: @base_template) if @base_template
SendTemplateUpdatedWebhookRequestJob.perform_later(@template)
maybe_redirect_to_template(@template)
else
render turbo_stream: turbo_stream.replace(:modal, template: 'templates/new'), status: :unprocessable_entity
@@ -70,6 +72,8 @@ class TemplatesController < ApplicationController
def update
@template.update!(template_params)
SendTemplateUpdatedWebhookRequestJob.perform_later(@template)
head :ok
end