Add OBS group management feature and documentation
- Add group_name column to teams table for mapping teams to OBS groups - Create API endpoints for group creation (/api/createGroup) and bulk sync (/api/syncGroups) - Update teams UI with group status display and creation buttons - Implement automatic group assignment when adding streams - Add comprehensive OBS setup documentation (docs/OBS_SETUP.md) - Fix team list spacing issue with explicit margins - Update OBS client with group management functions - Add database migration script for existing deployments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c259f0d943
commit
5789986bb6
14 changed files with 540 additions and 144 deletions
|
@ -1,4 +1,3 @@
|
|||
import { NextResponse } from 'next/server';
|
||||
import { getDatabase } from '../../../lib/database';
|
||||
import { Team } from '@/types';
|
||||
import { TABLE_NAMES } from '@/lib/constants';
|
||||
|
@ -39,14 +38,14 @@ function validateTeamInput(data: unknown): {
|
|||
|
||||
return {
|
||||
valid: true,
|
||||
data: { team_name: team_name.trim() }
|
||||
data: { team_name: (team_name as string).trim() }
|
||||
};
|
||||
}
|
||||
|
||||
export const GET = withErrorHandling(async () => {
|
||||
try {
|
||||
const db = await getDatabase();
|
||||
const teams: Team[] = await db.all(`SELECT * FROM ${TABLE_NAMES.TEAMS} ORDER BY team_name ASC`);
|
||||
const teams: Team[] = await db.all(`SELECT team_id, team_name, group_name FROM ${TABLE_NAMES.TEAMS} ORDER BY team_name ASC`);
|
||||
|
||||
return createSuccessResponse(teams);
|
||||
} catch (error) {
|
||||
|
@ -86,7 +85,8 @@ export const POST = withErrorHandling(async (request: Request) => {
|
|||
|
||||
const newTeam: Team = {
|
||||
team_id: result.lastID!,
|
||||
team_name: team_name
|
||||
team_name: team_name,
|
||||
group_name: null
|
||||
};
|
||||
|
||||
return createSuccessResponse(newTeam, 201);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue