mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 10:51:13 -05:00
Fix feature path catch blocks
This commit is contained in:
@@ -68,7 +68,7 @@ export function AddRideCreditDialog({ userId, open, onOpenChange, onSuccess }: A
|
||||
handleReset();
|
||||
onSuccess(data.id); // Pass the new ID
|
||||
onOpenChange(false);
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
console.error('Error adding credit:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
} finally {
|
||||
|
||||
@@ -68,7 +68,7 @@ export function RideCreditCard({ credit, position, maxPosition, viewMode, isEdit
|
||||
setIsEditing(false);
|
||||
// Optimistic update - pass specific changes
|
||||
onUpdate(credit.id, { ride_count: editCount });
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
console.error('Error updating count:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
} finally {
|
||||
@@ -91,7 +91,7 @@ export function RideCreditCard({ credit, position, maxPosition, viewMode, isEdit
|
||||
if (error) throw error;
|
||||
|
||||
toast.success('Ride count increased');
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
console.error('Error incrementing count:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
// Rollback on error
|
||||
@@ -111,7 +111,7 @@ export function RideCreditCard({ credit, position, maxPosition, viewMode, isEdit
|
||||
try {
|
||||
await onReorder(credit.id, editPosition);
|
||||
toast.success('Position updated');
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
console.error('Error changing position:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
setEditPosition(position);
|
||||
|
||||
@@ -43,7 +43,7 @@ export function UserBlockButton({ targetUserId, targetUsername, variant = 'outli
|
||||
});
|
||||
|
||||
setReason('');
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
console.error('Error blocking user:', errorMsg);
|
||||
toast({
|
||||
|
||||
@@ -93,7 +93,7 @@ export function UserReviewsList({ userId, reviewCount }: UserReviewsListProps) {
|
||||
|
||||
if (error) throw error;
|
||||
setReviews(data || []);
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
console.error('Error fetching reviews:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user