Fix types

This commit is contained in:
Adria Navarro 2024-08-26 10:58:58 +02:00
parent 3cfe556b0f
commit de3eae2d47
2 changed files with 7 additions and 2 deletions

View File

@ -41,7 +41,7 @@ export async function create(tableId: string, rowAction: { name: string }) {
throw e throw e
} }
doc = { _id: rowActionsId, actions: {} } doc = { _id: rowActionsId, tableId, actions: {} }
} }
ensureUniqueAndThrow(doc, action.name) ensureUniqueAndThrow(doc, action.name)
@ -75,6 +75,10 @@ export async function create(tableId: string, rowAction: { name: string }) {
doc.actions[newRowActionId] = { doc.actions[newRowActionId] = {
name: action.name, name: action.name,
automationId: automation._id!, automationId: automation._id!,
permissions: {
table: { runAllowed: true },
views: {},
},
} }
await db.put(doc) await db.put(doc)
@ -115,7 +119,7 @@ export async function update(
ensureUniqueAndThrow(actionsDoc, action.name, rowActionId) ensureUniqueAndThrow(actionsDoc, action.name, rowActionId)
actionsDoc.actions[rowActionId] = { actionsDoc.actions[rowActionId] = {
automationId: actionsDoc.actions[rowActionId].automationId, ...actionsDoc.actions[rowActionId],
...action, ...action,
} }

View File

@ -2,6 +2,7 @@ import { Document } from "../document"
export interface TableRowActions extends Document { export interface TableRowActions extends Document {
_id: string _id: string
tableId: string
actions: Record< actions: Record<
string, string,
{ {