mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 22:52:32 -05:00
allow to set default field values via api
This commit is contained in:
1 parent
d875477ee6
commit
c57148eada
5 files changed
+89
-12
No files matched your search
@@ -2,13 +2,17 @@
|
||||
|
||||
module Api
|
||||
class TemplatesController < ApiBaseController
|
||||
before_action :load_template, only: %i[show update]
|
||||
|
||||
def index
|
||||
render json: current_account.templates
|
||||
end
|
||||
|
||||
def update
|
||||
@template = current_account.templates.find(params[:id])
|
||||
def show
|
||||
render json: @template.as_json(include: { author: { only: %i[id email first_name last_name] } })
|
||||
end
|
||||
|
||||
def update
|
||||
@template.update!(template_params)
|
||||
|
||||
render :ok
|
||||
@@ -23,5 +27,9 @@ module Api
|
||||
fields: [[:uuid, :submitter_uuid, :name, :type, :required,
|
||||
{ options: [], areas: [%i[x y w h cell_w attachment_uuid page]] }]])
|
||||
end
|
||||
|
||||
def load_template
|
||||
@template = current_account.templates.find(params[:id])
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user