Reference this line and serialize import:
|
const body = serialize(element) |
If the element is a form then couldn't this just be simplifed as new FormData(element) and pass that onto fetch ? There's no need to manually serialize form and it's elements...