I wonder how I can add items to my data object.
This is how I make a post request using axios:
axios({
method: 'post',
url: 'someUrl',
responseType: 'json',
data: {
title: titleData
}
})
But sometimes I need to add more items to the data object depending on how many fields the user has filled.
So sometimes the request data might look like this:
axios({
method: 'post',
url: 'someUrl',
responseType: 'json',
data: {
title: titleData,
location: locationData,
isReady: readyData
}
})
So how can I push items to the data: {}
object?