Parsed an int to be an in (BAD).

This commit is contained in:
BurnyLlama 2021-11-01 19:54:59 +01:00
parent f91be3aa28
commit f4213888a8

View File

@ -26,7 +26,7 @@ export default function searcher(table, matchField=undefined, matchQuery=undefin
(resolve, reject) => {
const pageCount =
method === "get" ? 0 :
parseInt(sqlite
sqlite
.prepare(`
SELECT count(*) FROM ${simpleSanitize(table)}
${matchField ? `WHERE ${simpleSanitize(matchField)} = $matchQuery` : ""}
@ -34,7 +34,6 @@ export default function searcher(table, matchField=undefined, matchQuery=undefin
.get({
matchQuery
})
)
if (method === "all" && page > pageCount)
reject(`Page number too high! Page count: ${pageCount}`)