Now dividing total rows by entries/page for actual page count.
This commit is contained in:
parent
7fff166c3e
commit
07b4dfe14b
|
@ -26,6 +26,7 @@ export default function searcher(table, matchField=undefined, matchQuery=undefin
|
|||
(resolve, reject) => {
|
||||
const pageCount =
|
||||
method === "get" ? 0 :
|
||||
Math.ceil(
|
||||
sqlite
|
||||
.prepare(`
|
||||
SELECT count(*) FROM ${simpleSanitize(table)}
|
||||
|
@ -34,6 +35,8 @@ export default function searcher(table, matchField=undefined, matchQuery=undefin
|
|||
.get({
|
||||
matchQuery
|
||||
})['count(*)']
|
||||
/ entriesPerPage
|
||||
)
|
||||
|
||||
if (method === "all" && page > pageCount)
|
||||
reject(`Page number too high! Page count: ${pageCount}`)
|
||||
|
|
Loading…
Reference in New Issue
Block a user