Skip to content

Commit

Permalink
Organisation id is not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
DigneshGujarathi committed Jan 14, 2021
1 parent c2905d1 commit 4eb9ea9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 66 deletions.
7 changes: 1 addition & 6 deletions src/containers/WalletBalance/WalletBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -15,13 +14,10 @@ export interface WalletBalanceProps {
}

export const WalletBalance: React.FC<WalletBalanceProps> = ({ fullOpen }) => {
const variables = { organizationId: getUserSession('organizationId') };
const [displayBalance, setDisplayBalance] = useState<any>(null);

// get gupshup balance
const { data: balanceData, loading, error, subscribeToMore } = useQuery(BSPBALANCE, {
variables,
});
const { data: balanceData, loading, error, subscribeToMore } = useQuery(BSPBALANCE);

useEffect(() => {
if (balanceData) {
Expand All @@ -35,7 +31,6 @@ export const WalletBalance: React.FC<WalletBalanceProps> = ({ fullOpen }) => {
if (subscribeToMore) {
subscribeToMore({
document: PERIODIC_INFO_SUBSCRIPTION,
variables,
updateQuery: (prev, { subscriptionData }) => {
const balance = JSON.parse(subscriptionData.data.periodicInfo.value);
setDisplayBalance(balance.balance);
Expand Down
60 changes: 0 additions & 60 deletions src/mocks/Organization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand Down

0 comments on commit 4eb9ea9

Please sign in to comment.