Fix tests
This commit is contained in:
parent
ccb5143383
commit
07607c0fd2
|
@ -20,8 +20,8 @@ export async function search(options: SearchParams) {
|
||||||
const { tableId } = options
|
const { tableId } = options
|
||||||
const { paginate, query, ...params } = options
|
const { paginate, query, ...params } = options
|
||||||
const { limit } = params
|
const { limit } = params
|
||||||
let bookmark = (params.bookmark && parseInt(params.bookmark)) || undefined
|
let bookmark = (params.bookmark && parseInt(params.bookmark)) || null
|
||||||
if (paginate && bookmark) {
|
if (paginate && !bookmark) {
|
||||||
bookmark = 1
|
bookmark = 1
|
||||||
}
|
}
|
||||||
let paginateObj = {}
|
let paginateObj = {}
|
||||||
|
@ -68,7 +68,7 @@ export async function search(options: SearchParams) {
|
||||||
hasNextPage = nextRows.length > 0
|
hasNextPage = nextRows.length > 0
|
||||||
}
|
}
|
||||||
// need wrapper object for bookmarks etc when paginating
|
// need wrapper object for bookmarks etc when paginating
|
||||||
return { rows, hasNextPage, bookmark: (bookmark || 0) + 1 }
|
return { rows, hasNextPage, bookmark: bookmark && bookmark + 1 }
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err.message && err.message.includes("does not exist")) {
|
if (err.message && err.message.includes("does not exist")) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
Loading…
Reference in New Issue