File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,11 @@ export default function useFileUpload<T extends UploadItem = UploadItem>({
2727 const formData = new FormData ( ) ;
2828 formData . append ( field , item ) ;
2929
30- if ( data )
31- for ( const key in data )
30+ if ( data ) {
31+ for ( const key in data ) {
3232 formData . append ( key , data [ key ] ) ;
33+ }
34+ }
3335
3436 const xhr = new XMLHttpRequest ( ) ;
3537
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export type FileUploadOptions<T extends UploadItem = UploadItem> = {
3333 method ?: string ;
3434 headers ?: Headers ;
3535 timeout ?: number ;
36- data ?: { [ key : string ] : string } ;
36+ data ?: { [ key : string ] : string } ;
3737 onProgress ?: ( data : OnProgressData < T > ) => void ;
3838 onDone ?: ( data : OnDoneData < T > ) => void ;
3939 onError ?: ( data : OnErrorData < T > ) => void ;
You can’t perform that action at this time.
0 commit comments