From 60a5f4a2e72da9130cedb32c5ed4948d3eb2934b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Oct 2024 15:11:11 +0200 Subject: [PATCH] Types --- packages/server/src/api/controllers/row/index.ts | 13 ++++++++++++- packages/server/src/api/routes/tests/search.spec.ts | 1 + packages/types/src/api/web/app/rows.ts | 7 ------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 769a1dbe5e..0e4e305ce7 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -222,10 +222,21 @@ export async function search(ctx: Ctx) { ) const searchParams: RequiredKeys = { - ...searchRequest, query: enrichedQuery, tableId, viewId, + bookmark: searchRequest.bookmark, + paginate: searchRequest.paginate, + limit: searchRequest.limit, + sort: searchRequest.sort, + sortOrder: searchRequest.sortOrder, + sortType: searchRequest.sortType, + countRows: searchRequest.countRows, + version: searchRequest.version, + disableEscaping: searchRequest.disableEscaping, + fields: undefined, + indexer: undefined, + rows: undefined, } ctx.status = 200 diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 1ccc9bfdc9..a53f650d22 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -187,6 +187,7 @@ describe.each([ if (isInMemory) { return dataFilters.search(_.cloneDeep(rows), { ...this.query, + query: this.query.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 a02081366c..013e349fe5 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -80,13 +80,6 @@ const searchRowRequest = z.object({ version: z.string().optional(), disableEscaping: z.boolean().optional(), countRows: z.boolean().optional(), - - // viewId?: string - // query?: SearchFilters - - // fields?: string[] - // indexer?: () => Promise - // rows?: Row[] }) export const searchRowRequestValidator = searchRowRequest export type SearchRowRequest = z.infer