fix(trading): missing party ID when there is no SLA data (#5446)
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
This commit is contained in:
parent
8a3657a9b9
commit
51ab02a2e2
@ -119,6 +119,8 @@ describe('getLiquidityProvision', () => {
|
|||||||
createdAt: '2022-12-16T09:28:29.071781Z',
|
createdAt: '2022-12-16T09:28:29.071781Z',
|
||||||
id: 'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59',
|
id: 'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59',
|
||||||
fee: '0.001',
|
fee: '0.001',
|
||||||
|
partyId:
|
||||||
|
'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59',
|
||||||
party: {
|
party: {
|
||||||
__typename: 'Party',
|
__typename: 'Party',
|
||||||
accountsConnection: {
|
accountsConnection: {
|
||||||
|
@ -5,17 +5,15 @@ import {
|
|||||||
} from '@vegaprotocol/data-provider';
|
} from '@vegaprotocol/data-provider';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
LiquidityProvidersDocument,
|
LiquidityProvidersDocument,
|
||||||
LiquidityProvisionsDocument,
|
LiquidityProvisionsDocument,
|
||||||
} from './__generated__/MarketLiquidity';
|
} from './__generated__/MarketLiquidity';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
LiquidityProviderFieldsFragment,
|
LiquidityProviderFieldsFragment,
|
||||||
|
LiquidityProvisionFieldsFragment,
|
||||||
LiquidityProvidersQuery,
|
LiquidityProvidersQuery,
|
||||||
LiquidityProvidersQueryVariables,
|
LiquidityProvidersQueryVariables,
|
||||||
LiquidityProvisionFieldsFragment,
|
|
||||||
LiquidityProvisionsQuery,
|
LiquidityProvisionsQuery,
|
||||||
LiquidityProvisionsQueryVariables,
|
LiquidityProvisionsQueryVariables,
|
||||||
} from './__generated__/MarketLiquidity';
|
} from './__generated__/MarketLiquidity';
|
||||||
@ -163,7 +161,14 @@ export const getLiquidityProvision = (
|
|||||||
const liquidityProvider = liquidityProviders.find(
|
const liquidityProvider = liquidityProviders.find(
|
||||||
(f) => liquidityProvision.party.id === f.partyId
|
(f) => liquidityProvision.party.id === f.partyId
|
||||||
);
|
);
|
||||||
if (!liquidityProvider) return liquidityProvision;
|
|
||||||
|
if (!liquidityProvider) {
|
||||||
|
return {
|
||||||
|
...liquidityProvision,
|
||||||
|
partyId: liquidityProvision.party.id,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const accounts = compact(
|
const accounts = compact(
|
||||||
liquidityProvision.party.accountsConnection?.edges
|
liquidityProvision.party.accountsConnection?.edges
|
||||||
).map((e) => e.node);
|
).map((e) => e.node);
|
||||||
|
Loading…
Reference in New Issue
Block a user