chore(types): fix tsconfig to exclude desktop from Next TS check; remove unused vars and fix hook deps; clean up remaining lint warnings

This commit is contained in:
Esdras Renan 2025-10-09 22:52:02 -03:00
parent 6ffd6c6392
commit 6d69fcfa3c
4 changed files with 8 additions and 12 deletions

View file

@ -37,7 +37,7 @@ export async function GET(request: Request) {
role: session.user.role.toUpperCase(), role: session.user.role.toUpperCase(),
}) })
viewerId = ensuredUser?._id ?? null viewerId = ensuredUser?._id ?? null
} catch (_error) { } catch {
return NextResponse.json({ error: "Falha ao sincronizar usuário com Convex" }, { status: 500 }) return NextResponse.json({ error: "Falha ao sincronizar usuário com Convex" }, { status: 500 })
} }
if (!viewerId) return NextResponse.json({ error: "Usuário não encontrado no Convex" }, { status: 403 }) if (!viewerId) return NextResponse.json({ error: "Usuário não encontrado no Convex" }, { status: 403 })
@ -75,7 +75,7 @@ export async function GET(request: Request) {
"Cache-Control": "no-store", "Cache-Control": "no-store",
}, },
}) })
} catch (_error) { } catch {
return NextResponse.json({ error: "Falha ao gerar CSV de horas por cliente" }, { status: 500 }) return NextResponse.json({ error: "Falha ao gerar CSV de horas por cliente" }, { status: 500 })
} }
} }

View file

@ -1,6 +1,6 @@
"use client" "use client"
import { useEffect, useMemo, useState, useTransition } from "react" import { useCallback, useEffect, useState, useTransition } from "react"
import { toast } from "sonner" import { toast } from "sonner"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
@ -52,7 +52,7 @@ export function AdminCompaniesManager({ initialCompanies }: { initialCompanies:
setForm({ ...c }) setForm({ ...c })
} }
async function loadLastAlerts(list: Company[] = companies) { const loadLastAlerts = useCallback(async (list: Company[] = companies) => {
if (!list || list.length === 0) return if (!list || list.length === 0) return
const params = new URLSearchParams({ slugs: list.map((c) => c.slug).join(",") }) const params = new URLSearchParams({ slugs: list.map((c) => c.slug).join(",") })
try { try {
@ -62,9 +62,9 @@ export function AdminCompaniesManager({ initialCompanies }: { initialCompanies:
} catch { } catch {
// ignore // ignore
} }
} }, [companies])
useEffect(() => { void loadLastAlerts(companies) }, [companies]) useEffect(() => { void loadLastAlerts(companies) }, [loadLastAlerts, companies])
async function handleSubmit(e: React.FormEvent) { async function handleSubmit(e: React.FormEvent) {
e.preventDefault() e.preventDefault()

View file

@ -308,11 +308,7 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
}, [ }, [
ticket.id, ticket.id,
ticket.workSummary, ticket.workSummary,
ticket.workSummary?.totalWorkedMs,
ticket.workSummary?.internalWorkedMs,
ticket.workSummary?.externalWorkedMs,
ticketActiveSession, ticketActiveSession,
ticketActiveSession?.id,
ticketActiveSessionStartedAtMs, ticketActiveSessionStartedAtMs,
ticketActiveSessionWorkType, ticketActiveSessionWorkType,
]) ])

View file

@ -24,5 +24,5 @@
} }
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"] "exclude": ["node_modules", "apps/desktop/**"]
} }