1
0
Fork 0
mirror of synced 2024-06-29 19:41:03 +12:00

Merge pull request #5498 from Budibase/bug/sev3/remove-row-rev

Remove Row Rev field for Actions and Automations
This commit is contained in:
melohagan 2022-04-20 12:39:06 +01:00 committed by GitHub
commit 67a268e2b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 17 deletions

View file

@ -26,14 +26,6 @@
on:change={value => (parameters.rowId = value.detail)}
/>
<Label small>Row Rev</Label>
<DrawerBindableInput
{bindings}
title="Row rev to delete"
value={parameters.revId}
on:change={value => (parameters.revId = value.detail)}
/>
<Label small />
<Checkbox text="Require confirmation" bind:value={parameters.confirm} />

View file

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

View file

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

View file

@ -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"

View file

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