Undefined context checks

This commit is contained in:
Adria Navarro 2024-07-19 11:18:09 +02:00
parent 67619364b9
commit 1843233168
1 changed files with 6 additions and 1 deletions

View File

@ -49,9 +49,14 @@ export async function create(tableId: string, rowAction: { name: string }) {
ensureUniqueAndThrow(doc, action.name)
const appId = context.getAppId()
if (!appId) {
throw new Error("Could not get the current appId")
}
const automation = await automations.create({
name: `${tableName}: ${action.name}`,
appId: context.getAppId()!,
appId,
definition: {
trigger: {
type: AutomationStepType.TRIGGER,