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 {
|
} else {
|
||||||
setError("Failed to load personal info");
|
setError("Failed to load personal info");
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch {
|
||||||
setError("Failed to load personal info");
|
setError("Failed to load personal info");
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@@ -192,7 +192,7 @@ function ManagePets({ sessionId, readOnly }: { sessionId: string | null; readOnl
|
|||||||
} else {
|
} else {
|
||||||
setError("Failed to load pets");
|
setError("Failed to load pets");
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch {
|
||||||
setError("Failed to load pets");
|
setError("Failed to load pets");
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -39,13 +39,6 @@ interface Service {
|
|||||||
isAddOn?: boolean;
|
isAddOn?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Groomer {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
specialties?: string[];
|
|
||||||
avatar?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AppointmentsSectionProps {
|
interface AppointmentsSectionProps {
|
||||||
sessionId: string | null;
|
sessionId: string | null;
|
||||||
readOnly: boolean;
|
readOnly: boolean;
|
||||||
@@ -104,7 +97,6 @@ const CONFIRMATION_STATUS_COLORS: Record<string, string> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const AppointmentsSection: React.FC<AppointmentsSectionProps> = ({ sessionId, readOnly }) => {
|
export const AppointmentsSection: React.FC<AppointmentsSectionProps> = ({ sessionId, readOnly }) => {
|
||||||
const [appointments, setAppointments] = useState<Appointment[]>([]);
|
|
||||||
const [upcomingAppointments, setUpcomingAppointments] = useState<Appointment[]>([]);
|
const [upcomingAppointments, setUpcomingAppointments] = useState<Appointment[]>([]);
|
||||||
const [pastAppointments, setPastAppointments] = useState<Appointment[]>([]);
|
const [pastAppointments, setPastAppointments] = useState<Appointment[]>([]);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
@@ -118,7 +110,6 @@ export const AppointmentsSection: React.FC<AppointmentsSectionProps> = ({ sessio
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchAppointments = async () => {
|
const fetchAppointments = async () => {
|
||||||
if (!sessionId) {
|
if (!sessionId) {
|
||||||
setAppointments([]);
|
|
||||||
setUpcomingAppointments([]);
|
setUpcomingAppointments([]);
|
||||||
setPastAppointments([]);
|
setPastAppointments([]);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
@@ -134,8 +125,6 @@ export const AppointmentsSection: React.FC<AppointmentsSectionProps> = ({ sessio
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
const fetchedAppointments: Appointment[] = data.appointments || data || [];
|
const fetchedAppointments: Appointment[] = data.appointments || data || [];
|
||||||
|
|
||||||
setAppointments(fetchedAppointments);
|
|
||||||
|
|
||||||
const upcoming = fetchedAppointments.filter((appt) => isUpcoming(appt));
|
const upcoming = fetchedAppointments.filter((appt) => isUpcoming(appt));
|
||||||
const past = fetchedAppointments.filter((appt) => !isUpcoming(appt));
|
const past = fetchedAppointments.filter((appt) => !isUpcoming(appt));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user