Files
siphoned-valut/app/api/ledger/route.ts
T
2026-10-12 23:37:40 +03:30

5 lines
503 B
TypeScript

import { ledgerSnapshot } from '../../../lib/share';
import { readLedger, isAdmin } from '../../../lib/server';
export const dynamic='force-dynamic';
export async function GET(){try{const rows=await readLedger();const snapshot=await ledgerSnapshot(rows);return Response.json({rows,shareUrl:snapshot.shareUrl,admin:await isAdmin()},{headers:{'Cache-Control':'no-store'}});}catch{return Response.json({error:'بارگذاری خزانه ممکن نشد. دوباره تلاش کنید.'},{status:503});}}