mirror of
https://github.com/RomySaputraSihananda/ares.git
synced 2026-08-12 18:28:06 +00:00
16 lines
461 B
TypeScript
16 lines
461 B
TypeScript
import { NextResponse } from "next/server";
|
|||
|
|
import { getOrders } from "@/lib/mt5";
|
||
|
|
import { NextRequest } from "next/server";
|
||
|
|
|
||
|
|
export const dynamic = "force-dynamic";
|
||
|
|
|
||
|
|
export async function GET(req: NextRequest) {
|
||
|
|
const symbol = req.nextUrl.searchParams.get("symbol") ?? undefined;
|
||
|
|
try {
|
||
|
|
const data = await getOrders(symbol);
|
||
|
|
return NextResponse.json(data);
|
||
|
|
} catch (e) {
|
||
|
|
return NextResponse.json({ error: String(e) }, { status: 502 });
|
||
|
|
}
|
||
|
|
}
|