From 54406fd6b56a51c0ea033ef8e92acbf7211a609f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 28 Aug 2024 14:56:40 +0200 Subject: [PATCH] Rename fetchView to fetchLegacyView --- packages/server/src/api/controllers/row/index.ts | 4 ++-- packages/server/src/api/controllers/view/views.ts | 4 ++-- packages/server/src/api/routes/view.ts | 2 +- packages/server/src/sdk/app/rows/search.ts | 4 ++-- packages/server/src/sdk/app/rows/search/internal/internal.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 7d6448ca6b..46aec4e11c 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -97,12 +97,12 @@ export const save = async (ctx: UserCtx) => { 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, diff --git a/packages/server/src/api/controllers/view/views.ts b/packages/server/src/api/controllers/view/views.ts index abcc8627f3..b1f1f6c154 100644 --- a/packages/server/src/api/controllers/view/views.ts +++ b/packages/server/src/api/controllers/view/views.ts @@ -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 diff --git a/packages/server/src/api/routes/view.ts b/packages/server/src/api/routes/view.ts index 545d3016a3..807d8e2f28 100644 --- a/packages/server/src/api/routes/view.ts +++ b/packages/server/src/api/routes/view.ts @@ -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( diff --git a/packages/server/src/sdk/app/rows/search.ts b/packages/server/src/sdk/app/rows/search.ts index 4aa091ce10..482621630c 100644 --- a/packages/server/src/sdk/app/rows/search.ts +++ b/packages/server/src/sdk/app/rows/search.ts @@ -121,9 +121,9 @@ export async function fetchRaw(tableId: string): Promise { return pickApi(tableId).fetchRaw(tableId) } -export async function fetchView( +export async function fetchLegacyView( viewName: string, params: ViewParams ): Promise { - return internal.fetchView(viewName, params) + return internal.fetchLegacyView(viewName, params) } diff --git a/packages/server/src/sdk/app/rows/search/internal/internal.ts b/packages/server/src/sdk/app/rows/search/internal/internal.ts index acc7033ce1..ae7bca3b0c 100644 --- a/packages/server/src/sdk/app/rows/search/internal/internal.ts +++ b/packages/server/src/sdk/app/rows/search/internal/internal.ts @@ -145,7 +145,7 @@ export async function fetchRaw(tableId: string): Promise { return rows as Row[] } -export async function fetchView( +export async function fetchLegacyView( viewName: string, options: { calculation: string; group: string; field: string } ): Promise {