{
query: ({ id, data }) => {
console.log(333, data);
return {
url: `/accounts/${id}/avatar/`,
method: "POST",
body: data,
headers: {
"Content-Type": "multipart/form-data;",
},
};
},
transformResponse: (response: IGenericResponse<IAccount>) =>
response.data,
}
),
без ошибки:
axios
.post(
`http://35.240.210.188/api/v1/accounts/${user?.id}/avatar/`,
formData,
{
headers: {
"Content-Type": "multipart/form-data",
Authorization:
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjk3NTQyMTExLCJpYXQiOjE2OTc0NTU3MTEsImp0aSI6Ijc4ZGY0NmE0ZjIyYzQwMWI4MWViNmVmNjcyZTE0OWZlIiwidXNlcl9pZCI6ImFmNmJjNmYwLWNjYjEtNGZmOC1iOTViLWIzYTdjNzM4OGM0NCJ9.JztPaAYNEmDPE2fXLEu0neFROSUDz6Xnis9M9DVfBo8",
},
}
)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
почему?
Авторизации нет на первом?
Обсуждают сегодня