1
0
Fork 0
mirror of synced 2024-07-15 03:05:57 +12:00

Remove last controller.row usages

This commit is contained in:
Adria Navarro 2024-01-26 11:24:32 +01:00
parent 39d0382a56
commit f1e90b8b01
2 changed files with 6 additions and 7 deletions

View file

@ -39,7 +39,6 @@ import {
view as viewController,
} from "./controllers"
import * as controllers from "./controllers"
import { cleanup } from "../../utilities/fileSystem"
import newid from "../../db/newid"
import { generateUserMetadataID } from "../../db/utils"
@ -56,7 +55,7 @@ import {
RelationshipFieldMetadata,
RelationshipType,
Row,
SearchFilters,
SearchParams,
SourceName,
Table,
TableSourceType,
@ -706,14 +705,11 @@ class TestConfiguration {
return this.api.row.fetch(tableId)
}
async searchRows(tableId: string, searchParams: SearchFilters = {}) {
async searchRows(tableId: string, searchParams?: SearchParams) {
if (!tableId && this.table) {
tableId = this.table._id!
}
const body = {
query: searchParams,
}
return this._req(body, { tableId }, controllers.row.search)
return this.api.row.search(tableId, searchParams)
}
// ROLE

View file

@ -7,6 +7,7 @@ import {
BulkImportRequest,
BulkImportResponse,
SearchRowResponse,
SearchParams,
} from "@budibase/types"
import TestConfiguration from "../TestConfiguration"
import { TestAPI } from "./base"
@ -154,10 +155,12 @@ export class RowAPI extends TestAPI {
search = async (
sourceId: string,
params?: SearchParams,
{ expectStatus } = { expectStatus: 200 }
): Promise<SearchRowResponse> => {
const request = this.request
.post(`/api/${sourceId}/search`)
.send(params)
.set(this.config.defaultHeaders())
.expect(expectStatus)