From ae7d82748381a2544993e359d375f3f747db8691 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Tue, 26 Mar 2024 21:54:08 +0200 Subject: [PATCH] Fixed type to always exist --- .../addNewVariableButtonComponent/addNewVariableButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx b/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx index 310115d90..71fd1ad07 100644 --- a/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx +++ b/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx @@ -25,9 +25,9 @@ export default function AddNewVariableButton({ children }): JSX.Element { function handleSaveVariable() { let data: { name: string; value: string; type?: string } = { name: key, + type, value, }; - if (type) data = { ...data, type }; registerGlobalVariable(data) .then((res) => { const { name, id, type } = res.data;