Fixing an inconsistency that was raised by a community member.

This commit is contained in:
mike12345567 2022-03-08 18:00:49 +00:00
parent 6728f4efde
commit ebee98133b
1 changed files with 4 additions and 4 deletions

View File

@ -33,11 +33,11 @@ exports.handleRequest = handleRequest
exports.patch = async ctx => {
const inputs = ctx.request.body
const tableId = ctx.params.tableId
const id = breakRowIdField(inputs._id)
const id = inputs._id
// don't save the ID to db
delete inputs._id
return handleRequest(DataSourceOperation.UPDATE, tableId, {
id,
id: breakRowIdField(id),
row: inputs,
})
}
@ -67,7 +67,7 @@ exports.find = async ctx => {
const id = ctx.params.rowId
const tableId = ctx.params.tableId
const response = await handleRequest(DataSourceOperation.READ, tableId, {
id,
id: breakRowIdField(id),
})
return response ? response[0] : response
}
@ -76,7 +76,7 @@ exports.destroy = async ctx => {
const tableId = ctx.params.tableId
const id = ctx.request.body._id
const { row } = await handleRequest(DataSourceOperation.DELETE, tableId, {
id,
id: breakRowIdField(id),
})
return { response: { ok: true }, row }
}