From 7ed45f71d273b1d12f6c377181a1c40d850a5d22 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 16:35:24 +0100 Subject: [PATCH] Fix type tests --- .../src/api/routes/tests/search.spec.ts | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 5384444067..8ba165ded0 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, @@ -208,9 +209,25 @@ if (descriptions.length) { private async performSearch(): Promise> { if (isInMemory) { - return dataFilters.search(_.cloneDeep(rows), { - ...this.query, - }) + const inMemoryQuery: RequiredKeys< + Omit + > = { + sort: this.query.sort, + query: { ...this.query.query }, + paginate: this.query.paginate, + bookmark: this.query.bookmark ?? undefined, + limit: this.query.limit, + sortOrder: this.query.sortOrder, + sortType: this.query.sortType ?? undefined, + 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), inMemoryQuery) } else { return config.api.row.search(tableOrViewId, this.query) }