This commit is contained in:
Adria Navarro 2024-11-20 16:14:03 +01:00
parent 94f475c060
commit ed6d434843
1 changed files with 6 additions and 5 deletions

View File

@ -29,19 +29,20 @@ export async function searchView(
await context.ensureSnippetContext(true) await context.ensureSnippetContext(true)
const searchOptions: RequiredKeys<SearchViewRowRequest> & const searchOptions: RequiredKeys<RowSearchParams> = {
RequiredKeys<
Pick<RowSearchParams, "tableId" | "viewId" | "query" | "fields">
> = {
tableId: view.tableId, tableId: view.tableId,
viewId: view.id, viewId: view.id,
query: body.query || {}, query: body.query || {},
fields: viewFields, fields: viewFields,
...getSortOptions(body, view), ...getSortOptions(body, view),
limit: body.limit, limit: body.limit,
bookmark: body.bookmark, bookmark: body.bookmark ?? undefined,
paginate: body.paginate, paginate: body.paginate,
countRows: body.countRows, countRows: body.countRows,
version: undefined,
disableEscaping: undefined,
indexer: undefined,
rows: undefined,
} }
const result = await sdk.rows.search(searchOptions, { const result = await sdk.rows.search(searchOptions, {