Reputation: 321
I have tried to put details to server but getting 403 error
below is my code.
export const updateAppTypeData = (appData) => async dispatch => {
const token = localStorage.getItem('token')
const response = await axios({
method : 'put',
url: ('http://localhost:8000/api/posts/appType/'+appData.id+'/'),
data: appData,
headers: {'Content-Type': 'application/json', 'Authorization': 'Token '+token},
json: true
}).then(function (response) {
console.log(response);
});
//dispatch({ type : FETCH_APP_TYPE , payload: response.data });
};
Any help will be a big plus. Thanks.
Upvotes: 1
Views: 1573