(id) => {
await fetch(http://127.0.0.1:8000/categories/${id}/, {
method: 'DELETE',
headers: {
'Authentication': Token ${window.localStorage.getItem('token')}
},
})
}
Ошибка в консоли
Access to fetch at 'http://127.0.0.1:8000/categories/14/' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field authentication is not allowed by Access-Control-Allow-Headers in preflight response.
Categories.js:16 DELETE http://127.0.0.1:8000/categories/14/ net::ERR_FAILED
Categories.js:56 Uncaught (in promise) TypeError: Failed to fetch
А гет запросы работают без ошибок
Обсуждают сегодня