fix types

This commit is contained in:
Josh Hawkins 2025-07-06 14:50:52 -05:00
parent 773911e036
commit 2c3196b491

View File

@ -98,7 +98,7 @@ export default function CreateTriggerDialog({
.number() .number()
.min(0, t("triggers.dialog.form.threshold.error.min")) .min(0, t("triggers.dialog.form.threshold.error.min"))
.max(1, t("triggers.dialog.form.threshold.error.max")), .max(1, t("triggers.dialog.form.threshold.error.max")),
actions: z.array(z.enum(["alert", "notification"])), actions: z.array(z.enum(["notification"])),
}); });
const form = useForm<z.infer<typeof formSchema>>({ const form = useForm<z.infer<typeof formSchema>>({
@ -346,13 +346,13 @@ export default function CreateTriggerDialog({
<Checkbox <Checkbox
checked={form checked={form
.watch("actions") .watch("actions")
.includes(action as "alert" | "notification")} .includes(action as TriggerAction)}
onCheckedChange={(checked) => { onCheckedChange={(checked) => {
const currentActions = form.getValues("actions"); const currentActions = form.getValues("actions");
if (checked) { if (checked) {
form.setValue("actions", [ form.setValue("actions", [
...currentActions, ...currentActions,
action as "alert" | "notification", action as TriggerAction,
]); ]);
} else { } else {
form.setValue( form.setValue(