File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
elements/BulkUpload/FormsManager Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,10 @@ export async function createFormData(
18
18
delete data . file
19
19
}
20
20
21
- let clientUploadContext = null
22
-
23
- if ( typeof uploadHandler === 'function' ) {
21
+ if ( file && typeof uploadHandler === 'function' ) {
24
22
let filename = file . name
25
- clientUploadContext = await uploadHandler ( {
23
+
24
+ const clientUploadContext = await uploadHandler ( {
26
25
file,
27
26
updateFilename : ( value ) => {
28
27
filename = value
Original file line number Diff line number Diff line change @@ -507,10 +507,9 @@ export const Form: React.FC<FormProps> = (props) => {
507
507
508
508
const handler = getUploadHandler ( { collectionSlug } )
509
509
510
- if ( typeof handler === 'function' ) {
511
- let clientUploadContext = null
510
+ if ( file && typeof handler === 'function' ) {
512
511
let filename = file . name
513
- clientUploadContext = await handler ( {
512
+ const clientUploadContext = await handler ( {
514
513
file,
515
514
updateFilename : ( value ) => {
516
515
filename = value
You can’t perform that action at this time.
0 commit comments