Rename fetchView to fetchLegacyView

This commit is contained in:
Adria Navarro 2024-08-28 14:56:40 +02:00
parent c7c48d6f8f
commit 54406fd6b5
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) gridSocket?.emitRowUpdate(ctx, row || squashed)
} }
export async function fetchView(ctx: any) { export async function fetchLegacyView(ctx: any) {
const viewName = decodeURIComponent(ctx.params.viewName) const viewName = decodeURIComponent(ctx.params.viewName)
const { calculation, group, field } = ctx.query const { calculation, group, field } = ctx.query
ctx.body = await sdk.rows.fetchView(viewName, { ctx.body = await sdk.rows.fetchLegacyView(viewName, {
calculation, calculation,
group: calculation ? group : null, group: calculation ? group : null,
field, field,

View File

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

View File

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

View File

@ -121,9 +121,9 @@ export async function fetchRaw(tableId: string): Promise<Row[]> {
return pickApi(tableId).fetchRaw(tableId) return pickApi(tableId).fetchRaw(tableId)
} }
export async function fetchView( export async function fetchLegacyView(
viewName: string, viewName: string,
params: ViewParams params: ViewParams
): Promise<Row[]> { ): 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[] return rows as Row[]
} }
export async function fetchView( export async function fetchLegacyView(
viewName: string, viewName: string,
options: { calculation: string; group: string; field: string } options: { calculation: string; group: string; field: string }
): Promise<Row[]> { ): Promise<Row[]> {