From fa6267a2accf14b33e81e00a9e5402b6ce9f0dcb Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 13 Apr 2021 17:41:32 +0100 Subject: [PATCH] Fixing an issue with save row, changing how pre existing was handled caused an issue. --- packages/server/src/api/controllers/row.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/server/src/api/controllers/row.js b/packages/server/src/api/controllers/row.js index 6ce6aa3e28..2987cbeace 100644 --- a/packages/server/src/api/controllers/row.js +++ b/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 - const existingRow = await db.get(inputs._id) - if (existingRow) { - ctx.params.rowId = inputs._id - await exports.patch(ctx) - return + if (inputs._id && inputs._rev) { + const existingRow = await db.get(inputs._id) + if (existingRow) { + ctx.params.rowId = inputs._id + await exports.patch(ctx) + return + } } if (!inputs._rev && !inputs._id) {