add otp swagger3
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { db } from "@/lib/db";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { authOptions } from "@/lib/auth";
|
||||
import { getApiUser } from "@/lib/apiAuth";
|
||||
import { validateTeamComposition } from "@/lib/teamValidation";
|
||||
|
||||
export async function POST() {
|
||||
const session = await getServerSession(authOptions);
|
||||
if (!session) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
export async function POST(req: NextRequest) {
|
||||
const apiUser = await getApiUser(req);
|
||||
if (!apiUser) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
|
||||
const team = await db.team.findUnique({
|
||||
where: { userId: (session.user as any).id },
|
||||
where: { userId: apiUser.id },
|
||||
include: { players: { include: { player: true } } },
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user