fix(lint): remove unused variables and fix catch blocks in portal sections
- AccountSettings.tsx: change catch(err) to catch (unused catch syntax) - Appointments.tsx: remove unused Groomer interface and appointments state Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
committed by
Flea Flicker
parent
fda06b9856
commit
b2d67f24bc
@@ -84,7 +84,7 @@ function PersonalInfo({ sessionId, readOnly }: { sessionId: string | null; readO
|
||||
} else {
|
||||
setError("Failed to load personal info");
|
||||
}
|
||||
} catch (err) {
|
||||
} catch {
|
||||
setError("Failed to load personal info");
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -192,7 +192,7 @@ function ManagePets({ sessionId, readOnly }: { sessionId: string | null; readOnl
|
||||
} else {
|
||||
setError("Failed to load pets");
|
||||
}
|
||||
} catch (err) {
|
||||
} catch {
|
||||
setError("Failed to load pets");
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
@@ -39,13 +39,6 @@ interface Service {
|
||||
isAddOn?: boolean;
|
||||
}
|
||||
|
||||
interface Groomer {
|
||||
id: string;
|
||||
name: string;
|
||||
specialties?: string[];
|
||||
avatar?: string;
|
||||
}
|
||||
|
||||
interface AppointmentsSectionProps {
|
||||
sessionId: string | null;
|
||||
readOnly: boolean;
|
||||
@@ -104,7 +97,6 @@ const CONFIRMATION_STATUS_COLORS: Record<string, string> = {
|
||||
};
|
||||
|
||||
export const AppointmentsSection: React.FC<AppointmentsSectionProps> = ({ sessionId, readOnly }) => {
|
||||
const [appointments, setAppointments] = useState<Appointment[]>([]);
|
||||
const [upcomingAppointments, setUpcomingAppointments] = useState<Appointment[]>([]);
|
||||
const [pastAppointments, setPastAppointments] = useState<Appointment[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
@@ -118,7 +110,6 @@ export const AppointmentsSection: React.FC<AppointmentsSectionProps> = ({ sessio
|
||||
useEffect(() => {
|
||||
const fetchAppointments = async () => {
|
||||
if (!sessionId) {
|
||||
setAppointments([]);
|
||||
setUpcomingAppointments([]);
|
||||
setPastAppointments([]);
|
||||
setIsLoading(false);
|
||||
@@ -134,8 +125,6 @@ export const AppointmentsSection: React.FC<AppointmentsSectionProps> = ({ sessio
|
||||
const data = await response.json();
|
||||
const fetchedAppointments: Appointment[] = data.appointments || data || [];
|
||||
|
||||
setAppointments(fetchedAppointments);
|
||||
|
||||
const upcoming = fetchedAppointments.filter((appt) => isUpcoming(appt));
|
||||
const past = fetchedAppointments.filter((appt) => !isUpcoming(appt));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user