File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/enketo-express/public/js/src/module Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,18 @@ export class FormController {
151151
152152 async processForm ( formData , formFiles ) {
153153 const doc = this . _parser . parseFromString ( formData , 'text/xml' ) ;
154- console . log ( "form DATA ND FILES:" , formData , formFiles )
154+
155+ // Uploading images to Minio and replacing in formData
156+ for ( let i = 0 ; i < formFiles . length ; i ++ ) {
157+ let minioUri = await this . uploadFile ( formFiles [ i ] ) ;
158+ console . log ( minioUri , formFiles [ i ] . name ) ;
159+ if ( minioUri ) {
160+ formData = formData . replace ( formFiles [ i ] . name , minioUri ) ;
161+ }
162+ }
163+
164+ console . log ( "Updated FormData:" , formData ) ;
165+
155166 const parseRes = await fetch ( `${ settings . formManagerBaseURI } /parse` , {
156167 method : "POST" ,
157168 body : JSON . stringify ( { xml : formData . toString ( ) } ) ,
You can’t perform that action at this time.
0 commit comments