File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,10 @@ export function validatePDFConfiguration({
138138 customPDFs,
139139 validatedFormElements,
140140} : {
141- pdfConfiguration : SubmissionEventTypes . PDFConfiguration | undefined
141+ pdfConfiguration :
142+ | SubmissionEventTypes . PDFConfiguration
143+ | SubmissionEventTypes . PDFConfiguration [ ]
144+ | undefined
142145 propertyName : string
143146 customPDFs : FormTypes . Form [ 'customPDFs' ]
144147 validatedFormElements : FormTypes . FormElement [ ]
@@ -147,6 +150,19 @@ export function validatePDFConfiguration({
147150 return
148151 }
149152
153+ if ( Array . isArray ( pdfConfiguration ) ) {
154+ pdfConfiguration . forEach ( ( pdfConfig , index ) => {
155+ validatePDFConfiguration ( {
156+ pdfConfiguration : pdfConfig ,
157+ propertyName : `${ propertyName } [${ index } ]` ,
158+ customPDFs,
159+ validatedFormElements,
160+ } )
161+ } )
162+
163+ return
164+ }
165+
150166 const customPdfId = pdfConfiguration . customPdfId
151167 if ( customPdfId && ! customPDFs ?. some ( ( { id } ) => id === customPdfId ) ) {
152168 throw new Error (
You can’t perform that action at this time.
0 commit comments