rename to templates

This commit is contained in:
Alex Turchyn committed 2023-06-01 00:01:15 +03:00
1 parent 98fc9d964a
commit 4a303cb423
59 files changed
+248 -264

No files matched your search

@@ -0,0 +1,22 @@
# frozen_string_literal: true
module Api
class TemplatesController < ApiBaseController
def update
@template = current_account.templates.find(params[:id])
@template.update!(template_params)
render :ok
end
private
def template_params
params.require(:template).permit(:name,
schema: [%i[attachment_uuid name]],
fields: [[:uuid, :name, :type, :required,
{ options: [], areas: [%i[x y w h attachment_uuid page]] }]])
end
end
end