fix: incorrect parameters for public rows editing

This commit is contained in:
David Duong 2022-03-24 16:11:13 +01:00 committed by mike12345567
parent 573374408b
commit 26a29fef67
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ export async function read(ctx: any, next: any) {
} }
export async function update(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 rowController.save(ctx)
await next() await next()
} }
@ -60,7 +60,7 @@ export async function update(ctx: any, next: any) {
export async function destroy(ctx: any, next: any) { export async function destroy(ctx: any, next: any) {
// set the body as expected, with the _id and _rev fields // set the body as expected, with the _id and _rev fields
ctx.request.body = await addRev( ctx.request.body = await addRev(
fixRow({ _id: ctx.params.rowId }, ctx.params.tableId) fixRow({ _id: ctx.params.rowId }, ctx.params)
) )
await rowController.destroy(ctx) await rowController.destroy(ctx)
// destroy controller doesn't currently return the row as the body, need to adjust this // destroy controller doesn't currently return the row as the body, need to adjust this