From df0d99d93afbb6e3f1cdf3c4eb6666ca35193c30 Mon Sep 17 00:00:00 2001 From: David Duong Date: Thu, 24 Mar 2022 16:11:13 +0100 Subject: [PATCH] fix: incorrect parameters for public rows editing --- packages/server/src/api/controllers/public/rows.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/public/rows.ts b/packages/server/src/api/controllers/public/rows.ts index 4a3b255a36..0a598690e6 100644 --- a/packages/server/src/api/controllers/public/rows.ts +++ b/packages/server/src/api/controllers/public/rows.ts @@ -52,7 +52,7 @@ export async function read(ctx: any, next: any) { } export async function update(ctx: any, next: any) { - ctx.request.body = await addRev(fixRow(ctx.request.body, ctx.params.tableId)) + ctx.request.body = await addRev(fixRow(ctx.request.body, ctx.params)) await rowController.save(ctx) await next() } @@ -60,7 +60,7 @@ export async function update(ctx: any, next: any) { export async function destroy(ctx: any, next: any) { // set the body as expected, with the _id and _rev fields ctx.request.body = await addRev( - fixRow({ _id: ctx.params.rowId }, ctx.params.tableId) + fixRow({ _id: ctx.params.rowId }, ctx.params) ) await rowController.destroy(ctx) // destroy controller doesn't currently return the row as the body, need to adjust this