feat(admin): add admin payment tables + filters
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Has been cancelled

This commit is contained in:
2025-07-23 23:12:10 +05:00
parent dc3b5f9bf9
commit c34285c66d
4 changed files with 225 additions and 227 deletions

View File

@ -93,7 +93,7 @@ type GetPaymentProps = {
[key: string]: string | number | undefined; // Allow additional properties for flexibility
};
export async function getPayments(params: GetPaymentProps) {
export async function getPayments(params: GetPaymentProps, allPayments = false) {
// Build query string from all defined params
const query = Object.entries(params)
.filter(([_, value]) => value !== undefined && value !== "")
@ -101,7 +101,7 @@ export async function getPayments(params: GetPaymentProps) {
.join("&");
const session = await getServerSession(authOptions);
const response = await fetch(
`${process.env.SARLINK_API_BASE_URL}/api/billing/payment/?${query}`,
`${process.env.SARLINK_API_BASE_URL}/api/billing/payment/?${query}&all_payments=${allPayments}`,
{
method: "GET",
headers: {