Answer the question
In order to leave comments, you need to log in
At what stage to process data with API (vuex)?
I'm spinning pagination in the store and a small question arose.
An example of information returned from the back:
{last_page: 5, current_page: 1, per_page: 10, total: 100, count: 100, url: 'xyz.com'}
{lastPage: 5, currentPage: 1} // остальные поля не нужны
Answer the question
In order to leave comments, you need to log in
Do not do unnecessary things (make a "beautiful version"), but use the object as it is.
Or change the server part so that it gives the data in the format you need on the front.
Write a function that will bring the data to the desired format and call it before the mutation.
But it's better to change the backend response, if there is access.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question