From 566da4b2a3ac279407a43c9018448bd44555ef5a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 16 Jan 2025 16:58:57 +0100 Subject: [PATCH] ViewV2, return 404 if not found --- packages/server/src/sdk/app/views/external.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/sdk/app/views/external.ts b/packages/server/src/sdk/app/views/external.ts index 65e0ff410d..fabee903fe 100644 --- a/packages/server/src/sdk/app/views/external.ts +++ b/packages/server/src/sdk/app/views/external.ts @@ -22,7 +22,9 @@ export async function get(viewId: string): Promise { return ensureQueryUISet(found) } -export async function getEnriched(viewId: string): Promise { +export async function getEnriched( + viewId: string +): Promise { const { tableId } = utils.extractViewInfoFromID(viewId) const { datasourceId, tableName } = breakExternalTableId(tableId) @@ -32,7 +34,7 @@ export async function getEnriched(viewId: string): Promise { const views = Object.values(table.views!).filter(isV2) const found = views.find(v => v.id === viewId) if (!found) { - throw new Error("No view found") + return } return await enrichSchema(ensureQueryUISet(found), table.schema) }