1
0
Fork 0
mirror of synced 2024-09-20 03:08:18 +12:00

Merge branch 'master' into BUDI-8562/fix-trimming-views

This commit is contained in:
Adria Navarro 2024-08-28 16:22:34 +02:00 committed by GitHub
commit 92c3f4dba6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 8 deletions

View file

@ -97,12 +97,12 @@ export const save = async (ctx: UserCtx<Row, Row>) => {
gridSocket?.emitRowUpdate(ctx, row || squashed)
}
export async function fetchView(ctx: any) {
export async function fetchLegacyView(ctx: any) {
const viewName = decodeURIComponent(ctx.params.viewName)
const { calculation, group, field } = ctx.query
ctx.body = await sdk.rows.fetchView(viewName, {
ctx.body = await sdk.rows.fetchLegacyView(viewName, {
calculation,
group: calculation ? group : null,
field,

View file

@ -2,7 +2,7 @@ import viewTemplate from "./viewBuilder"
import { apiFileReturn } from "../../../utilities/fileSystem"
import { csv, json, jsonWithSchema, Format, isFormat } from "./exporters"
import { deleteView, getView, getViews, saveView } from "./utils"
import { fetchView } from "../row"
import { fetchLegacyView } from "../row"
import { context, events } from "@budibase/backend-core"
import sdk from "../../../sdk"
import {
@ -170,7 +170,7 @@ export async function exportView(ctx: Ctx) {
ctx.params.viewName = viewName
}
await fetchView(ctx)
await fetchLegacyView(ctx)
let rows = ctx.body as Row[]
let schema: TableSchema = view && view.meta && view.meta.schema

View file

@ -46,7 +46,7 @@ router
permissions.PermissionType.TABLE,
permissions.PermissionLevel.READ
),
rowController.fetchView
rowController.fetchLegacyView
)
.get("/api/views", authorized(permissions.BUILDER), viewController.v1.fetch)
.delete(

View file

@ -121,9 +121,9 @@ export async function fetchRaw(tableId: string): Promise<Row[]> {
return pickApi(tableId).fetchRaw(tableId)
}
export async function fetchView(
export async function fetchLegacyView(
viewName: string,
params: ViewParams
): Promise<Row[]> {
return internal.fetchView(viewName, params)
return internal.fetchLegacyView(viewName, params)
}

View file

@ -145,7 +145,7 @@ export async function fetchRaw(tableId: string): Promise<Row[]> {
return rows as Row[]
}
export async function fetchView(
export async function fetchLegacyView(
viewName: string,
options: { calculation: string; group: string; field: string }
): Promise<Row[]> {