refactor: Centralize UUID generation with fallback support

This commit is contained in:
Shirone
2026-01-16 23:49:36 +01:00
parent 5407e1a9ff
commit 16ef026b38
5 changed files with 44 additions and 7 deletions

View File

@@ -28,6 +28,7 @@ import type {
EventHookHttpAction,
} from '@automaker/types';
import { EVENT_HOOK_TRIGGER_LABELS } from '@automaker/types';
import { generateUUID } from '@/lib/utils';
interface EventHookDialogProps {
open: boolean;
@@ -108,7 +109,7 @@ export function EventHookDialog({ open, onOpenChange, editingHook, onSave }: Eve
const handleSave = () => {
const hook: EventHook = {
id: editingHook?.id || crypto.randomUUID(),
id: editingHook?.id || generateUUID(),
name: name.trim() || undefined,
trigger,
enabled: editingHook?.enabled ?? true,