Closed kosuha606 closed 2 years ago
Hello, in documentation we have such example
mock.onGet("/users").reply(200, { users: [{ id: 1, name: "John Smith" }], });
But for me it looks like data object from example replaces whole axios response object. I can't read users from axiosResponse.data
my axios code:
axios.get('/users').then((response) => console.log(response.data))
It works only if mock will be as follow:
mock.onGet("/users").reply(200, { data: { users: [{ id: 1, name: "John Smith" }], } });
Is this ok? Is it mistake in documentation or it is my misunderstanding?
Sorry, It was my misunderstanding.
In axios interseptors was code what changes response to response.data
Hello, in documentation we have such example
But for me it looks like data object from example replaces whole axios response object. I can't read users from axiosResponse.data
my axios code:
It works only if mock will be as follow:
Is this ok? Is it mistake in documentation or it is my misunderstanding?