This commit is contained in:
Adria Navarro 2024-10-10 15:11:11 +02:00
parent e095a596a1
commit 60a5f4a2e7
3 changed files with 13 additions and 8 deletions

View File

@ -222,10 +222,21 @@ export async function search(ctx: Ctx<SearchRowRequest, SearchRowResponse>) {
) )
const searchParams: RequiredKeys<RowSearchParams> = { const searchParams: RequiredKeys<RowSearchParams> = {
...searchRequest,
query: enrichedQuery, query: enrichedQuery,
tableId, tableId,
viewId, 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 ctx.status = 200

View File

@ -187,6 +187,7 @@ describe.each([
if (isInMemory) { if (isInMemory) {
return dataFilters.search(_.cloneDeep(rows), { return dataFilters.search(_.cloneDeep(rows), {
...this.query, ...this.query,
query: this.query.query!,
}) })
} else { } else {
return config.api.row.search(tableOrViewId, this.query) return config.api.row.search(tableOrViewId, this.query)

View File

@ -80,13 +80,6 @@ const searchRowRequest = z.object({
version: z.string().optional(), version: z.string().optional(),
disableEscaping: z.boolean().optional(), disableEscaping: z.boolean().optional(),
countRows: z.boolean().optional(), countRows: z.boolean().optional(),
// viewId?: string
// query?: SearchFilters
// fields?: string[]
// indexer?: () => Promise<any>
// rows?: Row[]
}) })
export const searchRowRequestValidator = searchRowRequest export const searchRowRequestValidator = searchRowRequest
export type SearchRowRequest = z.infer<typeof searchRowRequest> export type SearchRowRequest = z.infer<typeof searchRowRequest>