Fixing build issue.

This commit is contained in:
mike12345567 2024-05-22 16:02:11 +01:00
parent ff8684d9b4
commit 2ed510dc90
2 changed files with 7 additions and 5 deletions

View File

@ -4,8 +4,8 @@ import {
SearchRowResponse, SearchRowResponse,
SearchViewRowRequest, SearchViewRowRequest,
RequiredKeys, RequiredKeys,
SearchFilters,
RowSearchParams, RowSearchParams,
SearchFilterKey,
} from "@budibase/types" } from "@budibase/types"
import { dataFilters } from "@budibase/shared-core" import { dataFilters } from "@budibase/shared-core"
import sdk from "../../../sdk" import sdk from "../../../sdk"
@ -45,10 +45,7 @@ export async function searchView(
// Carry over filters for unused fields // Carry over filters for unused fields
Object.keys(body.query).forEach(key => { Object.keys(body.query).forEach(key => {
const operator = key as keyof Omit< const operator = key as SearchFilterKey
SearchFilters,
"allOr" | "onEmptyFilter"
>
Object.keys(body.query[operator] || {}).forEach(field => { Object.keys(body.query[operator] || {}).forEach(field => {
if (!existingFields.includes(db.removeKeyNumbering(field))) { if (!existingFields.includes(db.removeKeyNumbering(field))) {
query[operator]![field] = body.query[operator]![field] query[operator]![field] = body.query[operator]![field]

View File

@ -64,6 +64,11 @@ export interface SearchFilters {
} }
} }
export type SearchFilterKey = keyof Omit<
SearchFilters,
"allOr" | "onEmptyFilter" | "fuzzyOr"
>
export type SearchQueryFields = Omit<SearchFilters, "allOr" | "onEmptyFilter"> export type SearchQueryFields = Omit<SearchFilters, "allOr" | "onEmptyFilter">
export interface SortJson { export interface SortJson {