From 3fc1292473067d184709dfbaaa835b772bb4af33 Mon Sep 17 00:00:00 2001 From: gmbronco <83549293+gmbronco@users.noreply.github.com> Date: Wed, 18 Oct 2023 11:43:38 +0200 Subject: [PATCH] default chain as passed in the header --- modules/user/user.resolvers.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/user/user.resolvers.ts b/modules/user/user.resolvers.ts index 72ca4dafa..6c75f403a 100644 --- a/modules/user/user.resolvers.ts +++ b/modules/user/user.resolvers.ts @@ -2,14 +2,12 @@ import { Resolvers } from '../../schema'; import { userService } from './user.service'; import { getRequiredAccountAddress, isAdminRoute } from '../auth/auth-context'; import { tokenService } from '../token/token.service'; -import { $Enums } from '@prisma/client'; - -const allChains = Object.values($Enums.Chain); +import { networkContext } from '../network/network-context.service'; const resolvers: Resolvers = { Query: { userGetPoolBalances: async (parent, { chains, address }, context) => { - chains = chains && chains.length > 0 ? chains : allChains; + chains = chains && chains.length > 0 ? chains : [networkContext.chain]; const accountAddress = address || getRequiredAccountAddress(context); const tokenPrices = await tokenService.getTokenPricesForChains(chains); const balances = await userService.getUserPoolBalances(accountAddress, chains);