Skip to content

Commit fac2aeb

Browse files
committed
stb build
1 parent 788d8b7 commit fac2aeb

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/features/billing/api/use-get-billing-account.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ interface BillingAccountResponse {
1515
daysUntilSuspension?: number;
1616
currency: string;
1717
walletBalance?: number;
18+
walletLockedBalance?: number;
19+
availableBalance?: number;
1820
walletCurrency?: string;
1921
}
2022

src/features/organizations/components/organization-billing-settings.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import { useState, useCallback, useEffect } from "react";
4+
import { useQueryClient } from "@tanstack/react-query";
45
import { Wallet, DollarSign, FileText, ExternalLink, Calendar, Loader2, CheckCircle2, AlertTriangle, Info, Plus } from "lucide-react";
56
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
67
import { Button } from "@/components/ui/button";
@@ -44,6 +45,7 @@ export function OrganizationBillingSettings({
4445
organizationName,
4546
}: OrganizationBillingSettingsProps) {
4647
const { data: organization, isLoading: isOrgLoading } = useGetOrganization({ orgId: organizationId });
48+
const queryClient = useQueryClient();
4749
const { data: membersDoc } = useGetOrgMembers({ organizationId });
4850
const { data: invoicesDoc, isLoading: isInvoicesLoading } = useGetInvoices({
4951
organizationId,
@@ -227,8 +229,10 @@ export function OrganizationBillingSettings({
227229
}
228230

229231
toast.success(`₹${amount} added to your wallet successfully!`);
230-
// Refresh billing data to get updated balance
231-
window.location.reload();
232+
// Refresh billing data to get updated balance (without full page reload)
233+
queryClient.invalidateQueries({ queryKey: ["billing-account"] });
234+
queryClient.invalidateQueries({ queryKey: ["billing-status"] });
235+
setTopupAmount("");
232236
} catch (verifyError) {
233237
const msg = verifyError instanceof Error ? verifyError.message : "Verification failed";
234238
toast.error(`Payment issue: ${msg}. Please contact support if credits were not added.`);

src/features/wallet/server/route.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ const app = new Hono()
9898
zValidator("json", createTopupOrderSchema),
9999
async (c) => {
100100
const user = c.get("user");
101-
const { amount } = c.req.valid("json");
102-
103-
const organizationId = c.req.query("organizationId");
101+
const { amount, organizationId } = c.req.valid("json");
104102

105103
const { databases } = await createAdminClient();
106104

0 commit comments

Comments
 (0)