Fixed type to always exist

This commit is contained in:
Lucas Oliveira 2024-03-26 21:54:08 +02:00
commit ae7d827483

View file

@ -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;