When querying using fetch in js, I get data on the site /order/1
returns to me {uri:'/me/order/1'}
, which means that I am the owner of this resource at this moment, my user id is 1, then I go to the site under the data of another user with id=2 and my token is different
My code
fetch(`${runtimeConfig.public.apiBase}/orders/${route.params.id}`, {
method: 'GET',
cache: 'no-cache',
headers: {
'Authorization': `Bearer ${token.value}`
}
}).then((response) => {
return response.json();
}).then((data) => {
if (data && !data.uri) {
order.value = data
}
if (data.uri) {
getMyOrder(data.uri)
}
}).catch((err) => {
console.error("Error:", err);
});
I execute the request /order/1
and I get the result {uri:'/me/order/1'}
, although the user has changed and I should get {order_id:1, name: 'qwerty'}
, I checked, the token definitely belongs to another user. Everything works correctly in postman, I get the expected response, and in browsers I get what I think is a cached response
After the deletion request, I get this list
{order_id:2, name: 'asd'},
{order_id:3, name: 'rew'},
{order_id:0, name: ''}
]```
In Postman, there is no third element at all, as it should be