14 lines
382 B
TypeScript
14 lines
382 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { getQuotaInfo } from "@/lib/quota";
|
|
import { getSessionUser } from "@/lib/session";
|
|
|
|
export async function GET() {
|
|
const user = await getSessionUser();
|
|
if (!user) {
|
|
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
}
|
|
|
|
const quota = await getQuotaInfo(user.id);
|
|
return NextResponse.json(quota);
|
|
}
|