@@ -82,11 +82,11 @@ export class FeedbackForm {
82
82
label : 'Clear' ,
83
83
} ,
84
84
} ;
85
-
85
+ //https://fluid.libertymutual.com/fluid/fluid-file-upload.html
86
86
fileListUpdated ( event ) {
87
87
console . log ( event . detail ) ;
88
88
}
89
-
89
+ //https://fluid-components.libertymutual.com/fluid/fluid-file-upload.html
90
90
uploadClicked ( event ) {
91
91
console . log ( event . detail ) ;
92
92
}
@@ -304,12 +304,15 @@ export class FeedbackForm {
304
304
@State ( ) responseMessage : string = '' ;
305
305
@State ( ) userName : string = '' ; // State to capture user's name
306
306
@State ( ) userEmail : string = '' ; // State to capture user's email
307
+ @State ( ) fileUploaded : any = '' ; // State to capture user's uploaded document
307
308
handleInputChange ( event : Event , field : 'name' | 'email' ) {
308
309
const input = event . target as HTMLInputElement ;
309
310
if ( field === 'name' ) {
310
311
this . userName = input . value ;
311
312
} else if ( field === 'email' ) {
312
313
this . userEmail = input . value ;
314
+ } else if ( field === 'file' ) {
315
+ this . fileUploaded = input . value ;
313
316
}
314
317
}
315
318
//Before performing any operations- GET or SET- ensure that the this.editor instance is available
@@ -325,7 +328,7 @@ export class FeedbackForm {
325
328
headers : {
326
329
'Content-Type' : 'application/json' ,
327
330
} ,
328
- body : JSON . stringify ( { name : 'user' , content : this . editorContent } ) ,
331
+ body : JSON . stringify ( { name : this . userName , email : this . userEmail , file : this . fileUploaded , content : this . editorContent } ) ,
329
332
} ) ;
330
333
331
334
if ( ! response . ok ) {
0 commit comments