Fix record patch function
This commit is contained in:
parent
9eb15beb1c
commit
537c5a81e0
|
@ -18,8 +18,8 @@ validateJs.extend(validateJs.validators.datetime, {
|
|||
exports.patch = async function(ctx) {
|
||||
const instanceId = ctx.user.instanceId
|
||||
const db = new CouchDB(instanceId)
|
||||
const model = await db.get(record.modelId)
|
||||
let record = await db.get(ctx.params.id)
|
||||
const model = await db.get(record.modelId)
|
||||
const patchfields = ctx.request.body
|
||||
|
||||
for (let key of Object.keys(patchfields)) {
|
||||
|
|
Loading…
Reference in New Issue