diff --git a/kraken-app/kraken-app-portal/src/pages/NewAPIServer/components/SelectAPIServer.tsx b/kraken-app/kraken-app-portal/src/pages/NewAPIServer/components/SelectAPIServer.tsx index 12e3beb5..c0c7153a 100644 --- a/kraken-app/kraken-app-portal/src/pages/NewAPIServer/components/SelectAPIServer.tsx +++ b/kraken-app/kraken-app-portal/src/pages/NewAPIServer/components/SelectAPIServer.tsx @@ -4,16 +4,17 @@ import { Text } from "@/components/Text"; import { useGetValidateServerName } from '@/hooks/product'; import { useAppStore } from '@/stores/app.store'; import { validateServerName, validateURL } from '@/utils/helpers/validators'; -import { Form, FormInstance, Input } from "antd"; +import { Form, Input } from "antd"; +import { useMemo } from 'react'; type Props = { - form?: FormInstance; + name?: string; }; -const SelectAPIServer = ({ form }: Props) => { +const SelectAPIServer = ({ name }: Props) => { const { currentProduct } = useAppStore(); const { mutateAsync: validateName } = useGetValidateServerName(); - const originalName = form?.getFieldsValue(["name"])?.name ?? null; + const originalName = useMemo(() => name ?? "", [name]) return ( <> diff --git a/kraken-app/kraken-app-portal/src/pages/NewAPIServer/index.tsx b/kraken-app/kraken-app-portal/src/pages/NewAPIServer/index.tsx index 98b913a6..7760d058 100644 --- a/kraken-app/kraken-app-portal/src/pages/NewAPIServer/index.tsx +++ b/kraken-app/kraken-app-portal/src/pages/NewAPIServer/index.tsx @@ -195,7 +195,7 @@ const NewAPIServer = () => { >
- +