My code was working fine until today, so basically what this API
does is it sends a default gcm-id
to server and logs out the user, but I keep receiving this error from this morning, and I don't know if it's related to server-side or client, so here's my code and I wonder if I'm doing something wrong or what can I do to fix it?
const ExitAccount = () => {
const user = {
gcm_id: 1
};
const options = {
headers: {
'Authorization': this.state.Authorization,
'content-type': 'application/json'
}
};
axios.post('sth', { gcm_id: 1 }, options)
.then((response) => {
this.setState({ loading: false, Authorization: "sorryBuddy", profile:
"dropdownProfile hidden", login: "dropdownLogin show" })
localStorage.setItem('api_key', this.state.Authorization);
console.log(response)
});
}
And when I open network to see what's the problem it returns this
message: "can't find gcm_id"