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',
|
||||
id: 'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59',
|
||||
fee: '0.001',
|
||||
partyId:
|
||||
'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59',
|
||||
party: {
|
||||
__typename: 'Party',
|
||||
accountsConnection: {
|
||||
|
@ -5,17 +5,15 @@ import {
|
||||
} from '@vegaprotocol/data-provider';
|
||||
import * as Schema from '@vegaprotocol/types';
|
||||
import BigNumber from 'bignumber.js';
|
||||
|
||||
import {
|
||||
LiquidityProvidersDocument,
|
||||
LiquidityProvisionsDocument,
|
||||
} from './__generated__/MarketLiquidity';
|
||||
|
||||
import type {
|
||||
LiquidityProviderFieldsFragment,
|
||||
LiquidityProvisionFieldsFragment,
|
||||
LiquidityProvidersQuery,
|
||||
LiquidityProvidersQueryVariables,
|
||||
LiquidityProvisionFieldsFragment,
|
||||
LiquidityProvisionsQuery,
|
||||
LiquidityProvisionsQueryVariables,
|
||||
} from './__generated__/MarketLiquidity';
|
||||
@ -163,7 +161,14 @@ export const getLiquidityProvision = (
|
||||
const liquidityProvider = liquidityProviders.find(
|
||||
(f) => liquidityProvision.party.id === f.partyId
|
||||
);
|
||||
if (!liquidityProvider) return liquidityProvision;
|
||||
|
||||
if (!liquidityProvider) {
|
||||
return {
|
||||
...liquidityProvision,
|
||||
partyId: liquidityProvision.party.id,
|
||||
};
|
||||
}
|
||||
|
||||
const accounts = compact(
|
||||
liquidityProvision.party.accountsConnection?.edges
|
||||
).map((e) => e.node);
|
||||
|
Loading…
Reference in New Issue
Block a user