From 6ffa3d69dd54ae3f5787fdbfbbb1d2590cfa0c14 Mon Sep 17 00:00:00 2001 From: "groombook-ci[bot]" Date: Sun, 29 Mar 2026 12:25:26 +0000 Subject: [PATCH] fix(portal): address lint warnings and type safety - Export Appointment interface from Appointments.tsx for use elsewhere - CustomerPortal: use { id: string } for reschedule state instead of Record; cast to Appointment via unknown intermediate - AccountSettings: remove unused eslint-disable directive Co-Authored-By: Paperclip --- apps/web/src/portal/CustomerPortal.tsx | 11 ++++------- apps/web/src/portal/sections/AccountSettings.tsx | 1 - apps/web/src/portal/sections/Appointments.tsx | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/apps/web/src/portal/CustomerPortal.tsx b/apps/web/src/portal/CustomerPortal.tsx index d8ba8bc..c03e323 100644 --- a/apps/web/src/portal/CustomerPortal.tsx +++ b/apps/web/src/portal/CustomerPortal.tsx @@ -5,7 +5,7 @@ import { Settings, LogOut, Shield, } from "lucide-react"; import { Dashboard } from "./sections/Dashboard.js"; -import { AppointmentsSection, RescheduleFlow } from "./sections/Appointments.js"; +import { AppointmentsSection, RescheduleFlow, type Appointment } from "./sections/Appointments.js"; import { PetProfiles } from "./sections/PetProfiles.js"; import { ReportCards } from "./sections/ReportCards.js"; import { BillingPayments } from "./sections/BillingPayments.js"; @@ -33,7 +33,7 @@ export function CustomerPortal() { const [mobileNavOpen, setMobileNavOpen] = useState(false); const [showAuditLog, setShowAuditLog] = useState(false); const [showReschedule, setShowReschedule] = useState(false); - const [rescheduleAppointment, setRescheduleAppointment] = useState | null>(null); + const [rescheduleAppointment, setRescheduleAppointment] = useState<{ id: string } | null>(null); const [session, setSession] = useState(null); const [sessionExtended, setSessionExtended] = useState(false); const [clientName, setClientName] = useState(""); @@ -115,9 +115,7 @@ export function CustomerPortal() { }; const handleReschedule = useCallback((appointmentId: string) => { - // Look up the full appointment from Dashboard's displayed data - // The appointment was already fetched by Dashboard, so we use the ID to find it - setRescheduleAppointment({ id: appointmentId } as Record); + setRescheduleAppointment({ id: appointmentId }); setShowReschedule(true); }, []); @@ -176,9 +174,8 @@ export function CustomerPortal() { )} {showReschedule && rescheduleAppointment && ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any { setShowReschedule(false); setRescheduleAppointment(null); }} sessionId={session?.id ?? null} /> diff --git a/apps/web/src/portal/sections/AccountSettings.tsx b/apps/web/src/portal/sections/AccountSettings.tsx index 2fba3a6..8a5bc4e 100644 --- a/apps/web/src/portal/sections/AccountSettings.tsx +++ b/apps/web/src/portal/sections/AccountSettings.tsx @@ -225,7 +225,6 @@ function ManagePets({ sessionId, readOnly }: { sessionId: string | null; readOnl { setEditingPetId(null); setShowAddForm(false); }} onCancel={() => { setEditingPetId(null); setShowAddForm(false); }} /> diff --git a/apps/web/src/portal/sections/Appointments.tsx b/apps/web/src/portal/sections/Appointments.tsx index 03fcad1..ac25e82 100644 --- a/apps/web/src/portal/sections/Appointments.tsx +++ b/apps/web/src/portal/sections/Appointments.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import { Calendar, Clock, Plus, ChevronRight, ChevronDown, Loader2 } from 'lucide-react'; -interface Appointment { +export interface Appointment { id: string; petId: string; serviceId: string;