Fetch remaining data from paginated respond in Vue SPA
how i could make to bring all data in once on pagination data response without create another end-point?
Example
// Laravel method
public function getCars()
{
return Car::paginated();
}
// Vue SPA
// Using paginated data | work perfect
const getCars = async (page = 1) => {
const { data } = await httpClient.get("cars?page=" + page)
return data
}
//Lets say that i have 60 records, but i want to call the same end-point but bring all data in once
@jlrdw You can’t make a server-side endpoint magically return all records. Instead, do a for loop or something in your JavaScript code that hits the endpoint as many times as it needs to, incrementing the page number each time.