feat: add Solana USDT/USDC support and refine admin payouts UI
This commit is contained in:
23
app/api/admin/payouts/list/route.ts
Normal file
23
app/api/admin/payouts/list/route.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { db } from '@/lib/db';
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
try {
|
||||
const result = await db.query(`
|
||||
SELECT
|
||||
p.*,
|
||||
m.name as merchant_name
|
||||
FROM payouts p
|
||||
LEFT JOIN merchants m ON p.merchant_id = m.id
|
||||
ORDER BY p.created_at DESC
|
||||
`);
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
payouts: result.rows
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.error('[Payouts List API] Error:', error);
|
||||
return NextResponse.json({ error: error.message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user