mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 15:02:33 -05:00
add fields include option
This commit is contained in:
1 parent
de52f2f5e5
commit
58b337a3ee
5 files changed
+35
-6
No files matched your search
@@ -10,7 +10,7 @@ module Submitters
|
||||
|
||||
module_function
|
||||
|
||||
def call(submitter, with_template: false, with_events: false, with_documents: true, with_urls: false)
|
||||
def call(submitter, with_template: false, with_events: false, with_documents: true, with_urls: false, params: {})
|
||||
ActiveRecord::Associations::Preloader.new(
|
||||
records: [submitter],
|
||||
associations: if with_documents
|
||||
@@ -22,6 +22,10 @@ module Submitters
|
||||
|
||||
additional_attrs = {}
|
||||
|
||||
if params[:include].to_s.include?('fields')
|
||||
additional_attrs['fields'] = SerializeForWebhook.build_fields_array(submitter)
|
||||
end
|
||||
|
||||
additional_attrs['values'] = SerializeForWebhook.build_values_array(submitter)
|
||||
additional_attrs['documents'] = SerializeForWebhook.build_documents_array(submitter) if with_documents
|
||||
additional_attrs['preferences'] = submitter.preferences.except('default_values')
|
||||
|
||||
Reference in new issue
Block a user