So , i have three forms to be submitted at one click.
When submitted, the data collected from the three forms must create three rows in the DB through an API triggering a POST request
How do i pass the variable alldata to the API?
If i pass only one of them as data1, it perfectly works. But passing them as an array is not.
Appreciate your help.
const data1 = new FormData()
data1.set("images", values.image1)
data1.set("detail", values.detail1)
const data2 = new FormData()
data1.set("images", values.image2)
data1.set("detail", values.detail2)
const data3 = new FormData()
data1.set("images", values.image3)
data1.set("detail", values.detail3)
var alldata = [data1,data2,data3]
const res = axios(
"post",
"/APIGOESHERE"
alldata
)