to do calendar view

This commit is contained in:
2025-07-07 17:45:33 -04:00
parent de40c78f47
commit 5143be1a67
13 changed files with 225 additions and 26 deletions

View File

@@ -0,0 +1,20 @@
import { getServerSession } from "next-auth";
import { authOptions } from "../../auth/[...nextauth]/route";
import { NextResponse } from "next/server";
import { queries } from "@/lib/queries";
export async function GET() {
const session = await getServerSession(authOptions);
if (!session?.user.id) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
const user = await queries.fetchCurrentUser(session.user.id)
if (!user) {
return NextResponse.json({ error: 'User not found' }, { status: 404 });
}
return NextResponse.json(user);
}