From 4eb9ea9e6be7f235717b7106924629d240a8bc63 Mon Sep 17 00:00:00 2001 From: DigneshGujarathi Date: Thu, 14 Jan 2021 18:31:48 +0530 Subject: [PATCH] Organisation id is not needed anymore --- .../WalletBalance/WalletBalance.tsx | 7 +-- src/mocks/Organization.tsx | 60 ------------------- 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/src/containers/WalletBalance/WalletBalance.tsx b/src/containers/WalletBalance/WalletBalance.tsx index 01d44da95..ae12a3bd1 100644 --- a/src/containers/WalletBalance/WalletBalance.tsx +++ b/src/containers/WalletBalance/WalletBalance.tsx @@ -5,7 +5,6 @@ import { CircularProgress } from '@material-ui/core'; import styles from './WalletBalance.module.css'; import { ReactComponent as WhiteIcon } from '../../assets/images/icons/White.svg'; import { ReactComponent as SelectWhiteIcon } from '../../assets/images/icons/SelectWhite.svg'; -import { getUserSession } from '../../services/AuthService'; import { Tooltip } from '../../components/UI/Tooltip/Tooltip'; import { BSPBALANCE } from '../../graphql/queries/Organization'; import PERIODIC_INFO_SUBSCRIPTION from '../../graphql/subscriptions/PeriodicInfo'; @@ -15,13 +14,10 @@ export interface WalletBalanceProps { } export const WalletBalance: React.FC = ({ fullOpen }) => { - const variables = { organizationId: getUserSession('organizationId') }; const [displayBalance, setDisplayBalance] = useState(null); // get gupshup balance - const { data: balanceData, loading, error, subscribeToMore } = useQuery(BSPBALANCE, { - variables, - }); + const { data: balanceData, loading, error, subscribeToMore } = useQuery(BSPBALANCE); useEffect(() => { if (balanceData) { @@ -35,7 +31,6 @@ export const WalletBalance: React.FC = ({ fullOpen }) => { if (subscribeToMore) { subscribeToMore({ document: PERIODIC_INFO_SUBSCRIPTION, - variables, updateQuery: (prev, { subscriptionData }) => { const balance = JSON.parse(subscriptionData.data.periodicInfo.value); setDisplayBalance(balance.balance); diff --git a/src/mocks/Organization.tsx b/src/mocks/Organization.tsx index 615b1c9d1..1affdc8c5 100644 --- a/src/mocks/Organization.tsx +++ b/src/mocks/Organization.tsx @@ -392,21 +392,6 @@ export const walletBalanceSubscription = [ { request: { query: PERIODIC_INFO_SUBSCRIPTION, - variables: { organizationId: null }, - }, - result: { - data: { - periodicInfo: { - key: 'bsp_balance', - value: '{"balance":0.787}', - }, - }, - }, - }, - { - request: { - query: PERIODIC_INFO_SUBSCRIPTION, - variables: { organizationId: '1' }, }, result: { data: { @@ -423,21 +408,6 @@ export const walletBalanceHighSubscription = [ { request: { query: PERIODIC_INFO_SUBSCRIPTION, - variables: { organizationId: null }, - }, - result: { - data: { - periodicInfo: { - key: 'bsp_balance', - value: '{"balance":10.787}', - }, - }, - }, - }, - { - request: { - query: PERIODIC_INFO_SUBSCRIPTION, - variables: { organizationId: '1' }, }, result: { data: { @@ -454,21 +424,6 @@ export const walletBalanceQuery = [ { request: { query: BSPBALANCE, - variables: { organizationId: '1' }, - }, - result: { - data: { - bspbalance: { - key: 'bsp_balance', - value: '{"balance":0.628}', - }, - }, - }, - }, - { - request: { - query: BSPBALANCE, - variables: { organizationId: null }, }, result: { data: { @@ -485,21 +440,6 @@ export const walletBalanceHighQuery = [ { request: { query: BSPBALANCE, - variables: { organizationId: '1' }, - }, - result: { - data: { - bspbalance: { - key: 'bsp_balance', - value: '{"balance":10.379}', - }, - }, - }, - }, - { - request: { - query: BSPBALANCE, - variables: { organizationId: null }, }, result: { data: {