Change key to name

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-21 14:02:08 -03:00
commit 7f34516a52

View file

@ -11,24 +11,24 @@ export const useGlobalVariablesStore = create<GlobalVariablesStore>(
globalVariablesEntries: Object.keys(variables),
});
},
addGlobalVariable: (key, id, provider) => {
addGlobalVariable: (name, id, provider) => {
const data = { id, provider };
const newVariables = { ...get().globalVariables, [key]: data };
const newVariables = { ...get().globalVariables, [name]: data };
set({
globalVariables: newVariables,
globalVariablesEntries: Object.keys(newVariables),
});
},
removeGlobalVariable: (key) => {
removeGlobalVariable: (name) => {
const newVariables = { ...get().globalVariables };
delete newVariables[key];
delete newVariables[name];
set({
globalVariables: newVariables,
globalVariablesEntries: Object.keys(newVariables),
});
},
getVariableId: (key) => {
return get().globalVariables[key]?.id;
}
getVariableId: (name) => {
return get().globalVariables[name]?.id;
},
})
);