1
0
Fork 0
mirror of synced 2024-08-17 02:51:55 +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, view as viewController,
} from "./controllers" } from "./controllers"
import * as controllers from "./controllers"
import { cleanup } from "../../utilities/fileSystem" import { cleanup } from "../../utilities/fileSystem"
import newid from "../../db/newid" import newid from "../../db/newid"
import { generateUserMetadataID } from "../../db/utils" import { generateUserMetadataID } from "../../db/utils"
@ -56,7 +55,7 @@ import {
RelationshipFieldMetadata, RelationshipFieldMetadata,
RelationshipType, RelationshipType,
Row, Row,
SearchFilters, SearchParams,
SourceName, SourceName,
Table, Table,
TableSourceType, TableSourceType,
@ -706,14 +705,11 @@ class TestConfiguration {
return this.api.row.fetch(tableId) return this.api.row.fetch(tableId)
} }
async searchRows(tableId: string, searchParams: SearchFilters = {}) { async searchRows(tableId: string, searchParams?: SearchParams) {
if (!tableId && this.table) { if (!tableId && this.table) {
tableId = this.table._id! tableId = this.table._id!
} }
const body = { return this.api.row.search(tableId, searchParams)
query: searchParams,
}
return this._req(body, { tableId }, controllers.row.search)
} }
// ROLE // ROLE

View file

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