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> = {
|
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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue