This commit is contained in:
Timothy Jaeryang Baek committed 2026-06-09 13:14:41 +01:00
1 parent 0f1d358bec
commit 48f4c2c015
4 files changed
+195 -10

No files matched your search

+10
View File
@@ -16,6 +16,8 @@ export type AutomationData = {
updated_at: number;
last_run: AutomationRunData | null;
next_runs: number[] | null;
has_webhook: boolean;
webhook_url: string | null;
};
export type AutomationRunData = {
@@ -81,3 +83,11 @@ export async function getAutomationRuns(
): Promise<AutomationRunData[]> {
return fetchJSON(`/api/automations/${id}/runs?skip=${skip}&limit=${limit}`);
}
export async function generateWebhook(id: string): Promise<AutomationData> {
return fetchJSON(`/api/automations/${id}/webhook`, { method: 'POST' });
}
export async function deleteWebhook(id: string): Promise<AutomationData> {
return fetchJSON(`/api/automations/${id}/webhook`, { method: 'DELETE' });
}