Change key to name
This commit is contained in:
parent
69735b070f
commit
7f34516a52
1 changed files with 7 additions and 7 deletions
|
|
@ -11,24 +11,24 @@ export const useGlobalVariablesStore = create<GlobalVariablesStore>(
|
||||||
globalVariablesEntries: Object.keys(variables),
|
globalVariablesEntries: Object.keys(variables),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
addGlobalVariable: (key, id, provider) => {
|
addGlobalVariable: (name, id, provider) => {
|
||||||
const data = { id, provider };
|
const data = { id, provider };
|
||||||
const newVariables = { ...get().globalVariables, [key]: data };
|
const newVariables = { ...get().globalVariables, [name]: data };
|
||||||
set({
|
set({
|
||||||
globalVariables: newVariables,
|
globalVariables: newVariables,
|
||||||
globalVariablesEntries: Object.keys(newVariables),
|
globalVariablesEntries: Object.keys(newVariables),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
removeGlobalVariable: (key) => {
|
removeGlobalVariable: (name) => {
|
||||||
const newVariables = { ...get().globalVariables };
|
const newVariables = { ...get().globalVariables };
|
||||||
delete newVariables[key];
|
delete newVariables[name];
|
||||||
set({
|
set({
|
||||||
globalVariables: newVariables,
|
globalVariables: newVariables,
|
||||||
globalVariablesEntries: Object.keys(newVariables),
|
globalVariablesEntries: Object.keys(newVariables),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getVariableId: (key) => {
|
getVariableId: (name) => {
|
||||||
return get().globalVariables[key]?.id;
|
return get().globalVariables[name]?.id;
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue