Parsed an int to be an in (BAD).
This commit is contained in:
parent
f91be3aa28
commit
f4213888a8
|
@ -26,7 +26,7 @@ export default function searcher(table, matchField=undefined, matchQuery=undefin
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
const pageCount =
|
const pageCount =
|
||||||
method === "get" ? 0 :
|
method === "get" ? 0 :
|
||||||
parseInt(sqlite
|
sqlite
|
||||||
.prepare(`
|
.prepare(`
|
||||||
SELECT count(*) FROM ${simpleSanitize(table)}
|
SELECT count(*) FROM ${simpleSanitize(table)}
|
||||||
${matchField ? `WHERE ${simpleSanitize(matchField)} = $matchQuery` : ""}
|
${matchField ? `WHERE ${simpleSanitize(matchField)} = $matchQuery` : ""}
|
||||||
|
@ -34,7 +34,6 @@ export default function searcher(table, matchField=undefined, matchQuery=undefin
|
||||||
.get({
|
.get({
|
||||||
matchQuery
|
matchQuery
|
||||||
})
|
})
|
||||||
)
|
|
||||||
|
|
||||||
if (method === "all" && page > pageCount)
|
if (method === "all" && page > pageCount)
|
||||||
reject(`Page number too high! Page count: ${pageCount}`)
|
reject(`Page number too high! Page count: ${pageCount}`)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user