From 5db74fbf5aa6cd6d6d491e63c381988c38943bfe Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Tue, 26 Mar 2024 21:50:44 +0200 Subject: [PATCH] Changed provider to type and hid field --- .../addNewVariableButton.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx b/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx index 6e77b67f6..2f0f3ec06 100644 --- a/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx +++ b/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx @@ -16,25 +16,25 @@ import { Textarea } from "../ui/textarea"; export default function AddNewVariableButton({ children }): JSX.Element { const [key, setKey] = useState(""); const [value, setValue] = useState(""); - const [provider, setProvider] = useState(""); + const [type, setType] = useState(""); const [open, setOpen] = useState(false); const setErrorData = useAlertStore((state) => state.setErrorData); const addGlobalVariable = useGlobalVariablesStore( (state) => state.addGlobalVariable ); function handleSaveVariable() { - let data: { name: string; value: string; provider?: string } = { + let data: { name: string; value: string; type?: string } = { name: key, value, }; - if (provider) data = { ...data, provider }; + if (type) data = { ...data, type }; registerGlobalVariable(data) .then((res) => { - const { name, id, provider } = res.data; - addGlobalVariable(name, id, provider); + const { name, id, type } = res.data; + addGlobalVariable(name, id, type); setKey(""); setValue(""); - setProvider(""); + setType(""); setOpen(false); }) .catch((error) => { @@ -62,7 +62,7 @@ export default function AddNewVariableButton({ children }): JSX.Element { {children}
- + { @@ -70,17 +70,17 @@ export default function AddNewVariableButton({ children }): JSX.Element { }} placeholder="Insert a name for the variable..." > - + {/* { - setProvider(e); + setType(e); }} - selectedOption={provider} + selectedOption={type} password={false} options={["OPENAI_API_KEY", "ANTHROPIC_API_KEY"]} - placeholder="Choose a provider between the environment variables..." - > - + placeholder="Choose a type between the environment variables..." + > */} +