Closed Centerworx closed 11 months ago
In the below code, you are stringifying the whole form and Files can not be stringified they do not get sent to the server.
export const createFormData = <T extends FieldValues>( data: T, key = "formData" ): FormData => { const formData = new FormData(); const finalData = JSON.stringify(data); formData.append(key, finalData); return formData; };
I'm working on the PR to fix this, and will submit it once I'm finished. I just wanted to document the issue first.
In the below code, you are stringifying the whole form and Files can not be stringified they do not get sent to the server.
export const createFormData = <T extends FieldValues>( data: T, key = "formData" ): FormData => { const formData = new FormData(); const finalData = JSON.stringify(data); formData.append(key, finalData); return formData; };
I'm working on the PR to fix this, and will submit it once I'm finished. I just wanted to document the issue first.