1
0
Fork 0
mirror of synced 2024-06-29 19:41:03 +12:00

Merge pull request #5077 from dqbd/patch-1

fix: incorrect parameters for public rows editing
This commit is contained in:
Michael Drury 2022-03-24 16:48:46 +00:00 committed by GitHub
commit b5ca86a4aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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