Allow nullable bookmarks

This commit is contained in:
Adria Navarro 2024-11-20 14:15:46 +01:00
parent 8519cfc495
commit 3250ad4947
2 changed files with 19 additions and 4 deletions

View File

@ -24,6 +24,7 @@ import {
JsonFieldSubType,
LogicalOperator,
RelationshipType,
RequiredKeys,
Row,
RowSearchParams,
SearchFilters,
@ -206,9 +207,23 @@ datasourceDescribe(
private async performSearch(): Promise<SearchResponse<Row>> {
if (isInMemory) {
return dataFilters.search(_.cloneDeep(rows), {
...this.query,
})
const query: RequiredKeys<Omit<RowSearchParams, "tableId">> = {
sort: this.query.sort,
query: this.query.query || {},
paginate: this.query.paginate,
bookmark: this.query.bookmark,
limit: this.query.limit,
sortOrder: this.query.sortOrder,
sortType: this.query.sortType,
version: this.query.version,
disableEscaping: this.query.disableEscaping,
countRows: this.query.countRows,
viewId: undefined,
fields: undefined,
indexer: undefined,
rows: undefined,
}
return dataFilters.search(_.cloneDeep(rows), query)
} else {
return config.api.row.search(tableOrViewId, this.query)
}

View File

@ -72,7 +72,7 @@ const searchRowRequest = z.object({
})
.optional(),
paginate: z.boolean().optional(),
bookmark: z.union([z.string(), z.number()]).optional(),
bookmark: z.union([z.string(), z.number()]).nullable().optional(),
limit: z.number().optional(),
sort: z.string().optional(),
sortOrder: z.nativeEnum(SortOrder).optional(),