chore: phase 1 lint/type fixes — commit all changes
This commit is contained in:
@@ -33,7 +33,7 @@ export function useCarMaintenanceList(carId: string | null) {
|
||||
.finally(() => setLoading(false));
|
||||
}, [carId]);
|
||||
|
||||
useEffect(() => { loadRecords(); }, [loadRecords]);
|
||||
useEffect(() => { queueMicrotask(loadRecords); }, [loadRecords]);
|
||||
|
||||
// Remove a record from the list right away, instead of waiting on a refetch.
|
||||
const removeRecord = useCallback((id: string) => {
|
||||
@@ -51,7 +51,7 @@ export function useCarMaintenanceDetail(carId: string | null, maintenanceId: str
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const loadRecord = useCallback(() => {
|
||||
if (!carId || !maintenanceId) return;
|
||||
const token = getStoredToken();
|
||||
setLoading(true);
|
||||
@@ -63,6 +63,8 @@ export function useCarMaintenanceDetail(carId: string | null, maintenanceId: str
|
||||
.finally(() => setLoading(false));
|
||||
}, [carId, maintenanceId]);
|
||||
|
||||
useEffect(() => { queueMicrotask(loadRecord); }, [loadRecord]);
|
||||
|
||||
return { record, loading, error };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user