api articles returns totalPages
This commit is contained in:
1 parent
a2b5b2a39a
commit
56a6735bfd
1 file changed
+2
-1
+2
-1
@@ -28,7 +28,7 @@ export async function findArticles(page, pageSize) {
|
|||||||
: []
|
: []
|
||||||
|
|
||||||
const total = await Article.total()
|
const total = await Article.total()
|
||||||
const totalPages = total / pageSize
|
const totalPages = Math.ceil(total / pageSize)
|
||||||
|
|
||||||
const id = i => i._id
|
const id = i => i._id
|
||||||
const pinnedIds = pinnedArticles.map(id)
|
const pinnedIds = pinnedArticles.map(id)
|
||||||
@@ -58,5 +58,6 @@ export async function findArticles(page, pageSize) {
|
|||||||
items,
|
items,
|
||||||
prevPage,
|
prevPage,
|
||||||
nextPage,
|
nextPage,
|
||||||
|
totalPages,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user