Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlemTuzlak committed Sep 17, 2024
1 parent 5eae55a commit 61951f0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/utilities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,16 @@ export const createFormData = <T extends FieldValues>(
// Handle strings
if (typeof value === "string") {
formData.append(key, value);
continue;
}
// Handle dates
if (value instanceof Date) {
formData.append(key, value.toISOString());
continue;
}
// Handle all the other values
else {
formData.append(key, JSON.stringify(value));
}

formData.append(key, JSON.stringify(value));
}

return formData;
Expand Down

0 comments on commit 61951f0

Please sign in to comment.