diff --git a/src/frontend/src/stores/globalVariables.ts b/src/frontend/src/stores/globalVariables.ts index 8eaaa3282..377cd00f0 100644 --- a/src/frontend/src/stores/globalVariables.ts +++ b/src/frontend/src/stores/globalVariables.ts @@ -11,8 +11,9 @@ export const useGlobalVariablesStore = create( globalVariablesEntries: Object.keys(variables), }); }, - addGlobalVariable: (key, value) => { - const newVariables = { ...get().globalVariables, [key]: value }; + addGlobalVariable: (key, id, provider) => { + const data = { id, provider }; + const newVariables = { ...get().globalVariables, [key]: data }; set({ globalVariables: newVariables, globalVariablesEntries: Object.keys(newVariables), diff --git a/src/frontend/src/types/zustand/globalVariables/index.ts b/src/frontend/src/types/zustand/globalVariables/index.ts index ed81caf1c..95c15a310 100644 --- a/src/frontend/src/types/zustand/globalVariables/index.ts +++ b/src/frontend/src/types/zustand/globalVariables/index.ts @@ -1,9 +1,9 @@ export type GlobalVariablesStore = { globalVariablesEntries: Array; - globalVariables: { [key: string]: { id: string; provider: string } }; + globalVariables: { [key: string]: { id: string; provider?: string } }; setGlobalVariables: (variables: { - [key: string]: { id: string; provider: string }; + [key: string]: { id: string; provider?: string }; }) => void; - addGlobalVariable: (key: string, value: string, provider?: string) => void; + addGlobalVariable: (key: string, id: string, provider?: string) => void; removeGlobalVariable: (key: string) => void; };