15 lines
550 B
TypeScript
15 lines
550 B
TypeScript
|
|
import { NextRequest, NextResponse } from "next/server";
|
||
|
|
|
||
|
|
const COMMUNITY_URL = process.env.COMMUNITY_URL || process.env.UMMAHID_URL || "http://ummahid:3000";
|
||
|
|
|
||
|
|
export async function GET() {
|
||
|
|
try {
|
||
|
|
const ummahRes = await fetch(`${COMMUNITY_URL}/api/v2/sadaqah/pool`);
|
||
|
|
const data = await ummahRes.json();
|
||
|
|
return NextResponse.json(data, { status: ummahRes.status });
|
||
|
|
} catch (error) {
|
||
|
|
console.error("[sadaqah-pool] Proxy error:", error);
|
||
|
|
return NextResponse.json({ error: "Failed to fetch sadaqah pool" }, { status: 502 });
|
||
|
|
}
|
||
|
|
}
|