This commit is contained in:
Adria Navarro 2024-10-23 16:37:55 +02:00
parent 7901c2d4ac
commit 11b2e40836
2 changed files with 0 additions and 24 deletions

View File

@ -76,16 +76,8 @@ export async function update(ctx: UserCtx) {
} }
export async function fetch(ctx: UserCtx<void, FetchAutomationResponse>) { export async function fetch(ctx: UserCtx<void, FetchAutomationResponse>) {
const query: { enrich?: string } = ctx.request.query || {}
const enrich = query.enrich === "true"
const automations = await sdk.automations.fetch() const automations = await sdk.automations.fetch()
ctx.body = { automations } ctx.body = { automations }
if (enrich) {
ctx.body.builderData = await sdk.automations.utils.getBuilderData(
automations
)
}
} }
export async function find(ctx: UserCtx) { export async function find(ctx: UserCtx) {

View File

@ -3,22 +3,6 @@ import { Automation } from "../../documents"
export interface DeleteAutomationResponse extends DocumentDestroyResponse {} export interface DeleteAutomationResponse extends DocumentDestroyResponse {}
export interface AutomationBuilderData {
displayName: string
triggerInfo?: {
type: string
table: {
id: string
name: string
}
rowAction: {
id: string
name: string
}
}
}
export interface FetchAutomationResponse { export interface FetchAutomationResponse {
automations: Automation[] automations: Automation[]
builderData?: Record<string, AutomationBuilderData> // The key will be the automationId
} }