diff --git a/frontend/src/services/graphql/Shared/getEnumByName.js b/frontend/src/services/graphql/Shared/getEnumByName.js index a24742df4..f4345544b 100644 --- a/frontend/src/services/graphql/Shared/getEnumByName.js +++ b/frontend/src/services/graphql/Shared/getEnumByName.js @@ -26,11 +26,11 @@ export const fetchEnums = async (client, enum_names) => { const response = await client.query( getEnumByName({ enum_names: enum_names }) ); + let enum_dict = {}; if (!response.errors && response.data.queryEnums != null) { - return Object.assign( - {}, - ...response.data.queryEnums.map((x) => ({ [x.name]: x.items })) - ); + response.data.queryEnums.map((x) => { + enum_dict[x.name] = x.items; + }); } - return {}; + return enum_dict; };