Types
This commit is contained in:
parent
e095a596a1
commit
60a5f4a2e7
|
@ -222,10 +222,21 @@ export async function search(ctx: Ctx<SearchRowRequest, SearchRowResponse>) {
|
|||
)
|
||||
|
||||
const searchParams: RequiredKeys<RowSearchParams> = {
|
||||
...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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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<any>
|
||||
// rows?: Row[]
|
||||
})
|
||||
export const searchRowRequestValidator = searchRowRequest
|
||||
export type SearchRowRequest = z.infer<typeof searchRowRequest>
|
||||
|
|
Loading…
Reference in New Issue