我正在尝试在获取请求后更改分页。 我的getAll请求结束后应该会改变。我该怎么做?
这是代码!谢谢!
function getAll(req, res, next){
myService.getAll()
.then(response => {
const res = response.body
myService.getFilms(res)
// after this i have to change the page and repeat the process until the last page
const actualPage = res.current_page
console.log(actualPage) // return 0
}).then(response => {
res.send(response)
})
.catch(error => {
console.log('Se produjo un error al postear los nuevos items')
next(error)
})
}
response.body是这样的:
{
"page_size": 20,
"current_page_size": 20,
"current_page": 0,
"total_elements": 882,
"total_pages": null,
"sort": null
"info": [ {.....} ]
}