NYYU Logo
APIWithdraw

Change Withdrawal Request Show Status

Hide or show withdrawal transactions in wallet transaction history

Change Withdrawal Request Show Status

Control visibility of withdrawal transactions in wallet history

USER Operation

Overview

These mutations allow users to toggle the visibility of withdrawal transactions on their wallet page. This helps users manage their transaction history display without deleting records.

Display Management

Changing show status only affects display visibility - it does not delete or modify the actual withdrawal records.

Supported Withdrawal Types

💳
PayPal Withdrawals

changePayPalWithdrawShowStatus

Crypto Withdrawals

changeCryptoWithdrawShowStatus

🏦
Bank Withdrawals

changeBankWithdrawShowStatus

GraphQL Schemas

PayPal Withdrawal Show Status

💳
changePayPalWithdrawShowStatus
changePayPalWithdrawShowStatus(
  id: Int!,
  showStatus: Int!
): Int

Crypto Withdrawal Show Status

changeCryptoWithdrawShowStatus
changeCryptoWithdrawShowStatus(
  id: Int!,
  showStatus: Int!
): Int

Bank Withdrawal Show Status

🏦
changeBankWithdrawShowStatus
changeBankWithdrawShowStatus(
  id: Int!,
  showStatus: Int!
): Int

Parameters

📋
Common Parameters
All three mutations share the same parameters
idInt! Required

The unique ID of the withdrawal transaction to update

showStatusInt! Required

New visibility status for the transaction

0: Hide transaction

1: Show transaction

Return Value

📊
Integer Response
Updated show status value
Return Type: Int

Returns the updated show status (0 for hidden, 1 for visible).

Example Mutations

👁️Show PayPal Withdrawal
mutation {
  changePayPalWithdrawShowStatus(
    id: 123,
    showStatus: 1
  )
}
Response
{
  "data": {
    "changePayPalWithdrawShowStatus": 1
  }
}
🚫Hide Crypto Withdrawal
mutation {
  changeCryptoWithdrawShowStatus(
    id: 456,
    showStatus: 0
  )
}
Response
{
  "data": {
    "changeCryptoWithdrawShowStatus": 0
  }
}
👁️Show Bank Withdrawal
mutation {
  changeBankWithdrawShowStatus(
    id: 789,
    showStatus: 1
  )
}

Implementation Example

// Unified function to change withdrawal visibility
async function toggleWithdrawalVisibility(
  withdrawalType: 'crypto' | 'paypal' | 'bank',
  withdrawalId: number,
  visible: boolean
) {
  try {
    const showStatus = visible ? 1 : 0;
    let mutation: string;

    switch (withdrawalType) {
      case 'crypto':
        mutation = `
          mutation ChangeCryptoShow($id: Int!, $showStatus: Int!) {
            changeCryptoWithdrawShowStatus(
              id: $id,
              showStatus: $showStatus
            )
          }
        `;
        break;

      case 'paypal':
        mutation = `
          mutation ChangePayPalShow($id: Int!, $showStatus: Int!) {
            changePayPalWithdrawShowStatus(
              id: $id,
              showStatus: $showStatus
            )
          }
        `;
        break;

      case 'bank':
        mutation = `
          mutation ChangeBankShow($id: Int!, $showStatus: Int!) {
            changeBankWithdrawShowStatus(
              id: $id,
              showStatus: $showStatus
            )
          }
        `;
        break;
    }

    const result = await client.request(mutation, {
      id: withdrawalId,
      showStatus
    });

    console.log(`✅ Withdrawal ${visible ? 'shown' : 'hidden'} successfully`);

    // Refresh transaction list in UI
    await refreshTransactionList();

    return result;

  } catch (error) {
    console.error('Failed to change withdrawal visibility:', error);
    throw error;
  }
}

// Usage examples
toggleWithdrawalVisibility('crypto', 123, false);  // Hide crypto withdrawal
toggleWithdrawalVisibility('paypal', 456, true);   // Show PayPal withdrawal
toggleWithdrawalVisibility('bank', 789, false);    // Hide bank withdrawal

Use Cases

🧹
Clean Transaction History

Hide old or completed withdrawals to declutter wallet transaction view

🔍
Focus on Active Transactions

Hide completed transactions to focus on pending withdrawal requests

🔄
Temporary Hidden State

Temporarily hide transactions and restore them later when needed

📊
Custom View Management

Create custom filtered views of transactions based on user preferences

UI Implementation Example

// React component for withdrawal list with hide/show toggle
function WithdrawalTransactionRow({ withdrawal, type }) {
  const [isVisible, setIsVisible] = useState(withdrawal.showStatus === 1);
  const [loading, setLoading] = useState(false);

  const toggleVisibility = async () => {
    setLoading(true);
    try {
      await toggleWithdrawalVisibility(
        type,
        withdrawal.id,
        !isVisible
      );
      setIsVisible(!isVisible);
    } catch (error) {
      console.error('Failed to toggle visibility:', error);
    } finally {
      setLoading(false);
    }
  };

  return (
    <div className="flex items-center justify-between p-4 border rounded-lg">
      <div className="flex-1">
        <div className="font-bold">{type.toUpperCase()} Withdrawal</div>
        <div className="text-sm text-muted-foreground">
          Amount: ${withdrawal.amount}
        </div>
        <div className="text-xs text-muted-foreground">
          Status: {withdrawal.status === 0 ? 'Pending' :
                   withdrawal.status === 1 ? 'Approved' : 'Denied'}
        </div>
      </div>

      <button
        onClick={toggleVisibility}
        disabled={loading}
        className="px-4 py-2 rounded bg-muted hover:bg-muted/80"
      >
        {loading ? 'Processing...' : isVisible ? 'Hide' : 'Show'}
      </button>
    </div>
  );
}

Best Practices

Provide Clear Toggle UI

Make it obvious to users which transactions are hidden and how to restore them

Preserve Data Integrity

Remember this only affects display - actual withdrawal records remain unchanged

Add "Show Hidden" Filter

Provide a filter option to view hidden transactions when needed

Sync State Immediately

Update UI state immediately after successful mutation for responsive UX

💡
Consider Bulk Operations

Allow users to hide/show multiple transactions at once for better UX

👁️
Display Management Only
Changing show status only affects visibility in the UI - all withdrawal records remain intact in the database