Closed harrygr closed 3 years ago
Tags can be provided as an array rather than a comma-separated string as FormData will coerce it.
const form = new FormData() form.append('tags', ['a', 'b']) Object.fromEntries(form) // Object { tags: "a,b" } ``
It looks like the type definition of Form.prototype.append only allows strings and Blobs so, even though passing a string[] does work it's not technically compliant with the api. Closing...
Form.prototype.append
string
Blob
string[]
Tags can be provided as an array rather than a comma-separated string as FormData will coerce it.