let bodyFormData = new FormData();
const { cardNumber, owner, date } = this.state;
const { token } = this.props;
bodyFormData.append( `number: ${cardNumber}`,`owner: ${owner}`, `expiration_date: ${date}`)
try {
const response = await axios.post(`/v1/card/update?access-token=${token}`,
{ data: bodyFormData }
);
} catch (error) {
console.log(error.response.data);
}
Object {
"code": 0,
"message": "Expired token",
"name": "Forbidden",
"status": 403,
}