Remove last controller.row usages
This commit is contained in:
parent
39d0382a56
commit
f1e90b8b01
2 changed files with 6 additions and 7 deletions
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue