import { apiFetch } from "@/lib/auth/api-client"; import { AutomationRule, UpdateAutomationRuleInput } from "./types"; export function fetchAutomationRules(): Promise { return apiFetch("/automation-rules"); } export function updateAutomationRule( id: string, input: UpdateAutomationRuleInput, ): Promise { return apiFetch(`/automation-rules/${encodeURIComponent(id)}`, { method: "PATCH", body: JSON.stringify(input), }); } export function resetAutomationRuleSequence(id: string): Promise { return apiFetch(`/automation-rules/${encodeURIComponent(id)}/reset-sequence`, { method: "POST", }); }