rename to templates

This commit is contained in:
Alex Turchyn
2023-05-31 23:19:20 +03:00
parent 98fc9d964a
commit 4a303cb423
59 changed files with 248 additions and 264 deletions
@@ -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