Skip to content

Commit 354c251

Browse files
track email
1 parent be00391 commit 354c251

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/feedback-form/feedback-form.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ export class FeedbackForm {
8282
label: 'Clear',
8383
},
8484
};
85-
85+
//https://fluid.libertymutual.com/fluid/fluid-file-upload.html
8686
fileListUpdated(event) {
8787
console.log(event.detail);
8888
}
89-
89+
//https://fluid-components.libertymutual.com/fluid/fluid-file-upload.html
9090
uploadClicked(event) {
9191
console.log(event.detail);
9292
}
@@ -304,12 +304,15 @@ export class FeedbackForm {
304304
@State() responseMessage: string = '';
305305
@State() userName: string = ''; // State to capture user's name
306306
@State() userEmail: string = ''; // State to capture user's email
307+
@State() fileUploaded: any = ''; // State to capture user's uploaded document
307308
handleInputChange(event: Event, field: 'name' | 'email') {
308309
const input = event.target as HTMLInputElement;
309310
if (field === 'name') {
310311
this.userName = input.value;
311312
} else if (field === 'email') {
312313
this.userEmail = input.value;
314+
} else if (field === 'file') {
315+
this.fileUploaded = input.value;
313316
}
314317
}
315318
//Before performing any operations- GET or SET- ensure that the this.editor instance is available
@@ -325,7 +328,7 @@ export class FeedbackForm {
325328
headers: {
326329
'Content-Type': 'application/json',
327330
},
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 }),
329332
});
330333

331334
if (!response.ok) {

0 commit comments

Comments
 (0)