This commit is contained in:
Adria Navarro 2024-08-29 13:08:59 +02:00
parent fc1be3c9f8
commit 79ed5cd5a6
1 changed files with 5 additions and 3 deletions

View File

@ -71,8 +71,9 @@ export async function patch(
}
export const save = async (ctx: UserCtx<Row, Row>) => {
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<void, GetRowResponse>) {
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)