diff --git a/actions/payment.ts b/actions/payment.ts index 1a35f27..6637c24 100644 --- a/actions/payment.ts +++ b/actions/payment.ts @@ -122,7 +122,7 @@ export async function getPayments(params: GetPaymentProps, allPayments = false) return data; } -export async function getTopups(params: GenericGetResponseProps) { +export async function getTopups(params: GenericGetResponseProps, all_topups = false) { // Build query string from all defined params const query = Object.entries(params) @@ -132,7 +132,7 @@ export async function getTopups(params: GenericGetResponseProps) { const session = await getServerSession(authOptions); const response = await fetch( - `${process.env.SARLINK_API_BASE_URL}/api/billing/topup/?${query}`, + `${process.env.SARLINK_API_BASE_URL}/api/billing/topup/?${query}&all_topups=${all_topups}`, { method: "GET", headers: { diff --git a/components/admin/admin-topup-table.tsx b/components/admin/admin-topup-table.tsx index c34b401..0b138f6 100644 --- a/components/admin/admin-topup-table.tsx +++ b/components/admin/admin-topup-table.tsx @@ -39,7 +39,7 @@ export async function AdminTopupsTable({ } apiParams.limit = limit; apiParams.offset = offset; - const [error, topups] = await tryCatch(getTopups(apiParams,)); + const [error, topups] = await tryCatch(getTopups(apiParams, true)); if (error) { if (error.message.includes("Unauthorized")) {