Fix viewV2 tests (for now)
This commit is contained in:
parent
81cd2a1559
commit
d2c0842c45
|
@ -6,6 +6,7 @@ import {
|
|||
UIFieldMetadata,
|
||||
UpdateViewRequest,
|
||||
ViewResponse,
|
||||
ViewResponseEnriched,
|
||||
ViewV2,
|
||||
} from "@budibase/types"
|
||||
import { builderSocket, gridSocket } from "../../../websockets"
|
||||
|
@ -39,9 +40,9 @@ async function parseSchema(view: CreateViewRequest) {
|
|||
return finalViewSchema
|
||||
}
|
||||
|
||||
export async function get(ctx: Ctx<void, ViewResponse>) {
|
||||
export async function get(ctx: Ctx<void, ViewResponseEnriched>) {
|
||||
ctx.body = {
|
||||
data: await sdk.views.get(ctx.params.viewId),
|
||||
data: await sdk.views.getEnriched(ctx.params.viewId),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import {
|
|||
import { db as dbCore } from "@budibase/backend-core"
|
||||
import { cloneDeep } from "lodash"
|
||||
|
||||
import sdk from "../../../sdk"
|
||||
import * as utils from "../../../db/utils"
|
||||
import { isExternalTableID } from "../../../integrations/utils"
|
||||
|
||||
|
@ -64,10 +63,6 @@ export function enrichSchema(
|
|||
view: ViewV2,
|
||||
tableSchema: TableSchema
|
||||
): ViewV2Enriched {
|
||||
if (!sdk.views.isV2(view)) {
|
||||
return view
|
||||
}
|
||||
|
||||
let schema = cloneDeep(tableSchema)
|
||||
const anyViewOrder = Object.values(view.schema || {}).some(
|
||||
ui => ui.order != null
|
||||
|
|
|
@ -4,9 +4,9 @@ import {
|
|||
ViewV2,
|
||||
SearchViewRowRequest,
|
||||
PaginatedSearchRowResponse,
|
||||
ViewV2Enriched,
|
||||
} from "@budibase/types"
|
||||
import { Expectations, TestAPI } from "./base"
|
||||
import sdk from "../../../sdk"
|
||||
|
||||
export class ViewV2API extends TestAPI {
|
||||
create = async (
|
||||
|
@ -44,10 +44,10 @@ export class ViewV2API extends TestAPI {
|
|||
return await this._delete(`/api/v2/views/${viewId}`, { expectations: exp })
|
||||
}
|
||||
|
||||
get = async (viewId: string, expectations?: Expectations) => {
|
||||
return await this._get<ViewV2Enriched>(`/api/v2/views/${viewId}`, {
|
||||
expectations,
|
||||
})
|
||||
get = async (viewId: string) => {
|
||||
return await this.config.doInContext(this.config.getAppId(), () =>
|
||||
sdk.views.get(viewId)
|
||||
)
|
||||
}
|
||||
|
||||
search = async (
|
||||
|
|
Loading…
Reference in New Issue