From 79ed5cd5a6fb99123c0496aff71406d6e5e5dbae Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Aug 2024 13:08:59 +0200 Subject: [PATCH] Fix --- packages/server/src/api/controllers/row/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 9292dd4cf3..cd85f57982 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -71,8 +71,9 @@ export async function patch( } export const save = async (ctx: UserCtx) => { - const { tableId } = utils.getSourceId(ctx) - const { sourceId } = ctx.params + const { tableId, viewId } = utils.getSourceId(ctx) + const sourceId = viewId || tableId + const appId = ctx.appId const body = ctx.request.body @@ -116,7 +117,8 @@ export async function fetch(ctx: any) { } export async function find(ctx: UserCtx) { - const { sourceId } = ctx.params + const { tableId, viewId } = utils.getSourceId(ctx) + const sourceId = viewId || tableId const rowId = ctx.params.rowId const response = await sdk.rows.find(sourceId, rowId)