Refactor getGlobalVariables function to store data in globalVariables object
This commit is contained in:
parent
9c24affbd1
commit
326a0f9866
1 changed files with 8 additions and 1 deletions
|
|
@ -854,7 +854,14 @@ export async function requestLogout() {
|
|||
export async function getGlobalVariables(): Promise<{
|
||||
[key: string]: { id: string; provider: string };
|
||||
}> {
|
||||
return (await api.get(`${BASE_URL_API}credentials/`)).data;
|
||||
const globalVariables = {};
|
||||
(await api.get(`${BASE_URL_API}credentials/`)).data.forEach((element) => {
|
||||
globalVariables[element.name] = {
|
||||
id: element.id,
|
||||
provider: element.provider,
|
||||
};
|
||||
});
|
||||
return globalVariables;
|
||||
}
|
||||
|
||||
export async function registerGlobalVariable(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue