Fix tests

This commit is contained in:
Adria Navarro 2023-08-03 14:32:03 +03:00
parent 227ac9dd88
commit 464ba92b47
3 changed files with 9 additions and 8 deletions

View File

@ -1212,11 +1212,9 @@ describe("/rows", () => {
const response = await config.api.viewV2.search( const response = await config.api.viewV2.search(
createViewResponse.id, createViewResponse.id,
{ {
sort: { sort: sortParams.field,
column: sortParams.field, sortOrder: sortParams.order,
order: sortParams.order, sortType: sortParams.type,
type: sortParams.type,
},
} }
) )

View File

@ -6,7 +6,7 @@ import {
PatchRowResponse, PatchRowResponse,
Row, Row,
ViewV2, ViewV2,
SearchRequest, SearchViewRowRequest,
} from "@budibase/types" } from "@budibase/types"
import TestConfiguration from "../TestConfiguration" import TestConfiguration from "../TestConfiguration"
import { TestAPI } from "./base" import { TestAPI } from "./base"
@ -80,7 +80,7 @@ export class ViewV2API extends TestAPI {
search = async ( search = async (
viewId: string, viewId: string,
params?: SearchRequest, params?: SearchViewRowRequest,
{ expectStatus } = { expectStatus: 200 } { expectStatus } = { expectStatus: 200 }
) => { ) => {
return this.request return this.request

View File

@ -9,7 +9,10 @@ export interface PatchRowRequest extends Row {
export interface PatchRowResponse extends Row {} export interface PatchRowResponse extends Row {}
export interface SearchRowRequest extends SearchParams {} export interface SearchRowRequest extends Omit<SearchParams, "tableId"> {}
export interface SearchViewRowRequest
extends Pick<SearchRowRequest, "sort" | "sortOrder" | "sortType"> {}
export interface SearchRowResponse { export interface SearchRowResponse {
rows: any[] rows: any[]