Add output context to duplicate row action
This commit is contained in:
parent
707ed7419d
commit
dd5d0ffc7b
|
@ -37,6 +37,12 @@ export const getAvailableActions = (getAllActions = false) => {
|
||||||
{
|
{
|
||||||
name: "Duplicate Row",
|
name: "Duplicate Row",
|
||||||
component: DuplicateRow,
|
component: DuplicateRow,
|
||||||
|
context: [
|
||||||
|
{
|
||||||
|
label: "Duplicated row",
|
||||||
|
value: "row",
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Delete Row",
|
name: "Delete Row",
|
||||||
|
|
|
@ -46,7 +46,10 @@ const duplicateRowHandler = async (action, context) => {
|
||||||
}
|
}
|
||||||
delete draft._id
|
delete draft._id
|
||||||
delete draft._rev
|
delete draft._rev
|
||||||
await saveRow(draft)
|
const row = await saveRow(draft)
|
||||||
|
return {
|
||||||
|
row,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue