diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index fe13e5311f..6600cf0da1 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -24,6 +24,7 @@ import { JsonFieldSubType, LogicalOperator, RelationshipType, + RequiredKeys, Row, RowSearchParams, SearchFilters, @@ -206,9 +207,23 @@ datasourceDescribe( private async performSearch(): Promise> { if (isInMemory) { - return dataFilters.search(_.cloneDeep(rows), { - ...this.query, - }) + const query: RequiredKeys> = { + 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) } diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index 013e349fe5..34ef1ee4c1 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -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(),