Browse Source

Fixing an issue with save row, changing how pre existing was handled caused an issue.

pull/1383/head
mike12345567 5 years ago
parent
commit
fa6267a2ac
  1. 12
      packages/server/src/api/controllers/row.js

12
packages/server/src/api/controllers/row.js

@ -130,11 +130,13 @@ exports.save = async function(ctx) {
} }
// if the row obj had an _id then it will have been retrieved // if the row obj had an _id then it will have been retrieved
const existingRow = await db.get(inputs._id) if (inputs._id && inputs._rev) {
if (existingRow) { const existingRow = await db.get(inputs._id)
ctx.params.rowId = inputs._id if (existingRow) {
await exports.patch(ctx) ctx.params.rowId = inputs._id
return await exports.patch(ctx)
return
}
} }
if (!inputs._rev && !inputs._id) { if (!inputs._rev && !inputs._id) {

Loading…
Cancel
Save