This commit is contained in:
Vitalii Kiiko
2024-10-12 20:41:12 +02:00
parent 6bfe2f9728
commit 2bedcee172
5 changed files with 13 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ import LookupdataService from '../../../../service/lookupdata-service';
// store
import { storeSet } from '../../../../store';
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
import { mimeTypes } from '../../../../configData';
const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors, status }, ref) {
const navigate = useNavigate();
@@ -211,6 +212,11 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors, st
return values.status === 'PUBLISH'
}
const acceptAllFormats = () => {
console.log(mimeTypes.map(o => o.code))
return mimeTypes.map(o => o.code);
}
return (
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
<UnsavedChangesDetector getValuesFn={getValues}/>
@@ -243,7 +249,7 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors, st
errors={errors}
defaultValue={values['docs']}
config={{ required: __('È obbligatorio', 'gepafin') }}
accept={["application/pdf", "application/vnd.ms-excel"]}
accept={acceptAllFormats()}
chooseLabel={__('Aggiungi documento', 'gepafin')}
multiple={true}
doctype='document'