mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 20:31:13 -05:00
Continue console cleanup
This commit is contained in:
@@ -69,7 +69,6 @@ export function AddRideCreditDialog({ userId, open, onOpenChange, onSuccess }: A
|
||||
onSuccess(data.id); // Pass the new ID
|
||||
onOpenChange(false);
|
||||
} catch (error: unknown) {
|
||||
console.error('Error adding credit:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
|
||||
@@ -69,7 +69,6 @@ export function RideCreditCard({ credit, position, maxPosition, viewMode, isEdit
|
||||
// Optimistic update - pass specific changes
|
||||
onUpdate(credit.id, { ride_count: editCount });
|
||||
} catch (error: unknown) {
|
||||
console.error('Error updating count:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
} finally {
|
||||
setUpdating(false);
|
||||
@@ -92,7 +91,6 @@ export function RideCreditCard({ credit, position, maxPosition, viewMode, isEdit
|
||||
|
||||
toast.success('Ride count increased');
|
||||
} catch (error: unknown) {
|
||||
console.error('Error incrementing count:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
// Rollback on error
|
||||
onUpdate(credit.id, { ride_count: credit.ride_count });
|
||||
@@ -112,7 +110,6 @@ export function RideCreditCard({ credit, position, maxPosition, viewMode, isEdit
|
||||
await onReorder(credit.id, editPosition);
|
||||
toast.success('Position updated');
|
||||
} catch (error: unknown) {
|
||||
console.error('Error changing position:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
setEditPosition(position);
|
||||
}
|
||||
|
||||
@@ -44,11 +44,9 @@ export function UserBlockButton({ targetUserId, targetUsername, variant = 'outli
|
||||
|
||||
setReason('');
|
||||
} catch (error: unknown) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
console.error('Error blocking user:', errorMsg);
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: 'Failed to block user',
|
||||
description: getErrorMessage(error),
|
||||
variant: 'destructive'
|
||||
});
|
||||
} finally {
|
||||
|
||||
@@ -94,7 +94,6 @@ export function UserReviewsList({ userId, reviewCount }: UserReviewsListProps) {
|
||||
if (error) throw error;
|
||||
setReviews(data || []);
|
||||
} catch (error: unknown) {
|
||||
console.error('Error fetching reviews:', error);
|
||||
toast.error(getErrorMessage(error));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user