From 229ce5b0f0c51b27e4fe2c623ad1326ce3e8b516 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 27 Oct 2025 14:23:20 -0500 Subject: [PATCH] fix types --- web/src/components/input/NameAndIdFields.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/web/src/components/input/NameAndIdFields.tsx b/web/src/components/input/NameAndIdFields.tsx index 8dde4f56d..ad4ebcfcc 100644 --- a/web/src/components/input/NameAndIdFields.tsx +++ b/web/src/components/input/NameAndIdFields.tsx @@ -1,4 +1,4 @@ -import { Control } from "react-hook-form"; +import { Control, FieldValues, Path, PathValue } from "react-hook-form"; import { FormField, FormItem, @@ -13,11 +13,11 @@ import { useFormContext } from "react-hook-form"; import { generateFixedHash, isValidId } from "@/utils/stringUtil"; import { useTranslation } from "react-i18next"; -type NameAndIdFieldsProps = { - control: Control; +type NameAndIdFieldsProps = { + control: Control; type?: string; - nameField: string; - idField: string; + nameField: Path; + idField: Path; nameLabel: string; nameDescription?: string; idLabel?: string; @@ -27,7 +27,7 @@ type NameAndIdFieldsProps = { placeholderId?: string; }; -export default function NameAndIdFields({ +export default function NameAndIdFields({ control, type, nameField, @@ -39,9 +39,9 @@ export default function NameAndIdFields({ processId, placeholderName, placeholderId, -}: NameAndIdFieldsProps) { +}: NameAndIdFieldsProps) { const { t } = useTranslation(["common"]); - const { watch, setValue, trigger } = useFormContext(); + const { watch, setValue, trigger } = useFormContext(); const [isIdVisible, setIsIdVisible] = useState(false); const defaultProcessId = (name: string) => { @@ -59,7 +59,7 @@ export default function NameAndIdFields({ const subscription = watch((value, { name }) => { if (name === nameField) { const processedId = effectiveProcessId(value[nameField] || ""); - setValue(idField, processedId); + setValue(idField, processedId as PathValue>); trigger(idField); } });