diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/DeleteRow.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/DeleteRow.svelte
index 35a1a6ec86..0ca5bfaa76 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/DeleteRow.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/DeleteRow.svelte
@@ -26,14 +26,6 @@
on:change={value => (parameters.rowId = value.detail)}
/>
-
- (parameters.revId = value.detail)}
- />
-
diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js
index f851a623c0..4e35cb2e54 100644
--- a/packages/client/src/utils/buttonActions.js
+++ b/packages/client/src/utils/buttonActions.js
@@ -81,7 +81,7 @@ const duplicateRowHandler = async (action, context) => {
const deleteRowHandler = async action => {
const { tableId, revId, rowId } = action.parameters
- if (tableId && revId && rowId) {
+ if (tableId && rowId) {
try {
await API.deleteRow({ tableId, rowId, revId })
notificationStore.actions.success("Row deleted")
diff --git a/packages/frontend-core/src/api/rows.js b/packages/frontend-core/src/api/rows.js
index 6a0d278cf7..9f980678c5 100644
--- a/packages/frontend-core/src/api/rows.js
+++ b/packages/frontend-core/src/api/rows.js
@@ -35,7 +35,7 @@ export const buildRowEndpoints = API => ({
* @param revId the rev of the row to delete
*/
deleteRow: async ({ tableId, rowId, revId }) => {
- if (!tableId || !rowId || !revId) {
+ if (!tableId || !rowId) {
return
}
return await API.delete({
diff --git a/packages/server/src/api/controllers/row/internal.js b/packages/server/src/api/controllers/row/internal.js
index 68ff4ca88d..d8e18df43b 100644
--- a/packages/server/src/api/controllers/row/internal.js
+++ b/packages/server/src/api/controllers/row/internal.js
@@ -259,8 +259,9 @@ exports.find = async ctx => {
exports.destroy = async function (ctx) {
const db = getAppDB()
- const { _id, _rev } = ctx.request.body
+ const { _id } = ctx.request.body
let row = await db.get(_id)
+ let _rev = ctx.request.body._rev || row._rev
if (row.tableId !== ctx.params.tableId) {
throw "Supplied tableId doesn't match the row's tableId"
diff --git a/packages/server/src/automations/steps/deleteRow.js b/packages/server/src/automations/steps/deleteRow.js
index e41e5ad263..1e9acc5a41 100644
--- a/packages/server/src/automations/steps/deleteRow.js
+++ b/packages/server/src/automations/steps/deleteRow.js
@@ -24,12 +24,8 @@ exports.definition = {
type: "string",
title: "Row ID",
},
- revision: {
- type: "string",
- title: "Row Revision",
- },
},
- required: ["tableId", "id", "revision"],
+ required: ["tableId", "id"],
},
outputs: {
properties: {
@@ -53,7 +49,7 @@ exports.definition = {
}
exports.run = async function ({ inputs, appId, emitter }) {
- if (inputs.id == null || inputs.revision == null) {
+ if (inputs.id == null) {
return {
success: false,
response: {