I have to send the modified data to an api which has json format as below:
{
"Customer": {
"name": "ABC",
"email": [email protected],
"password": ""
},
"access": true,
"time": 2000
}
On save I want to set the respective state to api fields.
save=()=>{
let newCustomer={
access:this.state.access,
time:this.state.time,
name: //How can i set the state values for name,email and
password which is in nested form?
email:
password:
}
return axios.put('api',newCustomer)
.then(response => {
})
}