@@ -233,6 +233,8 @@ export const FieldForm = ({
233
233
formFields [ field . name ] = fieldData . settings [ field . name ] ?? null ;
234
234
} else if ( field . name === "maxValue" ) {
235
235
formFields [ field . name ] = fieldData . settings [ field . name ] ?? null ;
236
+ } else if ( field . name === "currency" ) {
237
+ formFields [ field . name ] = fieldData . settings ?. currency ?? "USD" ;
236
238
} else if ( field . name === "fileExtensions" ) {
237
239
formFields [ field . name ] = fieldData . settings [ field . name ] ?? null ;
238
240
} else if ( field . name === "fileExtensionsErrorMessage" ) {
@@ -429,6 +431,22 @@ export const FieldForm = ({
429
431
newErrorsObj [ inputName ] = "This field is required" ;
430
432
}
431
433
434
+ if (
435
+ inputName === "fileExtensions" &&
436
+ formData . fileExtensions !== null &&
437
+ ! ( formData . fileExtensions as string [ ] ) ?. length
438
+ ) {
439
+ newErrorsObj [ inputName ] = "This field is required" ;
440
+ }
441
+
442
+ if (
443
+ inputName === "fileExtensionsErrorMessage" &&
444
+ formData . fileExtensions !== null &&
445
+ formData . fileExtensionsErrorMessage === ""
446
+ ) {
447
+ newErrorsObj [ inputName ] = "This field is required" ;
448
+ }
449
+
432
450
if (
433
451
inputName in errors &&
434
452
! [
@@ -441,6 +459,7 @@ export const FieldForm = ({
441
459
"regexRestrictErrorMessage" ,
442
460
"minValue" ,
443
461
"maxValue" ,
462
+ "currency" ,
444
463
"fileExtensions" ,
445
464
"fileExtensionsErrorMessage" ,
446
465
] . includes ( inputName )
@@ -602,6 +621,9 @@ export const FieldForm = ({
602
621
...( formData . maxValue !== null && {
603
622
maxValue : formData . maxValue as number ,
604
623
} ) ,
624
+ ...( formData . currency !== null && {
625
+ currency : formData . currency as string ,
626
+ } ) ,
605
627
...( formData . fileExtensions && {
606
628
fileExtensions : formData . fileExtensions as string [ ] ,
607
629
} ) ,
0 commit comments