Closed kevinsbarnard closed 1 year ago
GET http://fathomnet.org:8080/users?size=10&page=0
Authorization: Bearer <token>
HTTP/1.1 200 OK
date: Tue, 19 Sep 2023 21:26:19 GMT
Content-Type: application/json
content-encoding: gzip
content-length: 1832
connection: close
{
"content": [
// omitted for brevity
],
"pageable": {
"size": 10,
"number": 0,
"sort": {}
},
"totalSize": 500
}
This is a micronaut serialization bug:
From the API docs, totalPages
is a default method on the Page interface. It looks like it's not getting picked up by micronaut's serialzation anymore. (It previously was when we used straight Jackson).
Also the work around proposed above is reported to no longer work.
It's probably best if we just roll our own totalPages method:
function totalPages(pageSize, totalSize) {
if (totalSize <= pageSize) {
return 1;
}
return Math.ceil(totalSize / pageSize);
}
Fixed in release 1.3.3. I've deployed the fix to the fathomnet server.
@ermbutler @hohonuuli Due to the Micronaut 3 -> 4 serialization changes, the API no longer has
totalPages
in pageable endpoint responses. This is causing several frontend issues with pagination.The community page:
The submissions page:
The account management (admin) interface: