Initial commit - OBS Source Switcher Plugin UI
Complete Next.js application for managing OBS Source Switcher - Stream management with multiple screen layouts - Team management CRUD operations - SQLite database integration - OBS WebSocket API integration - Updated to latest versions (Next.js 15.4.1, React 19.1.0, Tailwind CSS 4.0.0) - Enhanced .gitignore for privacy and development
This commit is contained in:
commit
1d4b1eefba
43 changed files with 9596 additions and 0 deletions
38
app/api/getTeamName/route.ts
Normal file
38
app/api/getTeamName/route.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getDatabase } from '../../../lib/database';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
// Extract the team_id from the query string
|
||||
const { searchParams } = new URL(request.url);
|
||||
const teamId = searchParams.get('team_id');
|
||||
|
||||
if (!teamId) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Missing team_id' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
const db = await getDatabase();
|
||||
const team = await db.get(
|
||||
'SELECT team_name FROM teams_2025_spring_adr WHERE team_id = ?',
|
||||
[teamId]
|
||||
);
|
||||
|
||||
if (!team) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Team not found' },
|
||||
{ status: 404 }
|
||||
);
|
||||
}
|
||||
|
||||
return NextResponse.json({ team_name: team.team_name });
|
||||
} catch (error) {
|
||||
console.error('Error fetching team name:', error instanceof Error ? error.message : String(error));
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch team name' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue