api articles returns totalPages

This commit is contained in:
tmshv committed 2019-08-02 15:31:37 +03:00
1 parent a2b5b2a39a
commit 56a6735bfd
1 file changed
+2 -1
+2 -1
View File
@@ -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,
} }
} }