import { db } from "@/lib/db" import fetchUserUsingAPI from "@/lib/validate-api"; import { NextResponse } from "next/server"; export async function POST(req: Request) { try { const user = await fetchUserUsingAPI(req) if (!user) { return new NextResponse("Unauthorized", { status: 401 }); } const connection = await db.twitchConnection.deleteMany({ where: { userId: user.id } }); return NextResponse.json(connection); } catch (error) { console.log("[CONNECTION/TWITCH]", error); return new NextResponse("Internal Error", { status: 500 }); } }