1
0
Fork 0
mirror of synced 2024-09-29 16:51:33 +13:00

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

This commit is contained in:
mike12345567 2021-04-13 17:41:32 +01:00
parent eea3ab8b07
commit fa6267a2ac

View file

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