Fix unused variables and clean up codebase
All checks were successful
Lint and Build / build (pull_request) Successful in 2m47s
All checks were successful
Lint and Build / build (pull_request) Successful in 2m47s
- Remove unused NextResponse imports from API routes - Remove unused result variable in teams DELETE route - Remove unused Link import from page.tsx - Remove unused inspectTextSourceProperties function from obsClient.js - Fix unused catch variables and response variables in test files - Clean up all ESLint warnings for unused variables
This commit is contained in:
parent
d75f599711
commit
b1215ea82c
10 changed files with 9 additions and 43 deletions
|
@ -27,8 +27,6 @@ describe('/api/streams', () => {
|
|||
|
||||
mockDb.all.mockResolvedValue(mockStreams);
|
||||
|
||||
const _response = await GET();
|
||||
|
||||
expect(mockDb.all).toHaveBeenCalledWith(
|
||||
expect.stringContaining('SELECT * FROM')
|
||||
);
|
||||
|
@ -40,8 +38,6 @@ describe('/api/streams', () => {
|
|||
it('returns empty array when no streams exist', async () => {
|
||||
mockDb.all.mockResolvedValue([]);
|
||||
|
||||
const _response = await GET();
|
||||
|
||||
const { NextResponse } = require('next/server');
|
||||
expect(NextResponse.json).toHaveBeenCalledWith([]);
|
||||
});
|
||||
|
@ -50,8 +46,6 @@ describe('/api/streams', () => {
|
|||
const dbError = new Error('Database connection failed');
|
||||
mockDb.all.mockRejectedValue(dbError);
|
||||
|
||||
const _response = await GET();
|
||||
|
||||
const { NextResponse } = require('next/server');
|
||||
expect(NextResponse.json).toHaveBeenCalledWith(
|
||||
{ error: 'Failed to fetch streams' },
|
||||
|
@ -64,8 +58,6 @@ describe('/api/streams', () => {
|
|||
const { getDatabase } = require('@/lib/database');
|
||||
getDatabase.mockRejectedValue(connectionError);
|
||||
|
||||
const _response = await GET();
|
||||
|
||||
const { NextResponse } = require('next/server');
|
||||
expect(NextResponse.json).toHaveBeenCalledWith(
|
||||
{ error: 'Failed to fetch streams' },
|
||||
|
|
|
@ -46,8 +46,6 @@ describe('/api/teams', () => {
|
|||
|
||||
mockDb.all.mockResolvedValue(mockTeams);
|
||||
|
||||
const _response = await GET();
|
||||
|
||||
expect(mockDb.all).toHaveBeenCalledWith(
|
||||
expect.stringContaining('SELECT * FROM')
|
||||
);
|
||||
|
@ -59,8 +57,6 @@ describe('/api/teams', () => {
|
|||
it('returns empty array when no teams exist', async () => {
|
||||
mockDb.all.mockResolvedValue([]);
|
||||
|
||||
const _response = await GET();
|
||||
|
||||
const { createSuccessResponse } = require('@/lib/apiHelpers');
|
||||
expect(createSuccessResponse).toHaveBeenCalledWith([]);
|
||||
});
|
||||
|
@ -69,8 +65,6 @@ describe('/api/teams', () => {
|
|||
const dbError = new Error('Table does not exist');
|
||||
mockDb.all.mockRejectedValue(dbError);
|
||||
|
||||
const _response = await GET();
|
||||
|
||||
const { createDatabaseError } = require('@/lib/apiHelpers');
|
||||
expect(createDatabaseError).toHaveBeenCalledWith('fetch teams', dbError);
|
||||
});
|
||||
|
@ -80,8 +74,6 @@ describe('/api/teams', () => {
|
|||
const { getDatabase } = require('@/lib/database');
|
||||
getDatabase.mockRejectedValue(connectionError);
|
||||
|
||||
const _response = await GET();
|
||||
|
||||
const { createDatabaseError } = require('@/lib/apiHelpers');
|
||||
expect(createDatabaseError).toHaveBeenCalledWith('fetch teams', connectionError);
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { NextResponse } from 'next/server';
|
||||
import { getDatabase } from '../../../lib/database';
|
||||
import { TABLE_NAMES } from '../../../lib/constants';
|
||||
import { createSuccessResponse, createDatabaseError, withErrorHandling } from '../../../lib/apiHelpers';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { NextResponse } from 'next/server';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { createSuccessResponse, createErrorResponse, withErrorHandling } from '../../../lib/apiHelpers';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { NextRequest } from 'next/server';
|
||||
import { getDatabase } from '../../../lib/database';
|
||||
import { TABLE_NAMES } from '../../../lib/constants';
|
||||
import { createErrorResponse, createSuccessResponse, createDatabaseError, withErrorHandling } from '../../../lib/apiHelpers';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { NextResponse } from 'next/server';
|
||||
import { getDatabase } from '../../../lib/database';
|
||||
import { StreamWithTeam } from '@/types';
|
||||
import { TABLE_NAMES } from '../../../lib/constants';
|
||||
|
|
|
@ -126,7 +126,7 @@ export async function DELETE(
|
|||
);
|
||||
|
||||
// Delete the team
|
||||
const result = await db.run(
|
||||
await db.run(
|
||||
`DELETE FROM ${TABLE_NAMES.TEAMS} WHERE team_id = ?`,
|
||||
[teamId]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue