mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 23:11:12 -05:00
Refactor: Implement logging and JSONB cleanup
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import type { EntityType, VersionDiff } from '@/types/versioning';
|
||||
import { handleError } from '@/lib/errorHandler';
|
||||
|
||||
/**
|
||||
* Hook to compare two versions of an entity and get the diff
|
||||
@@ -37,7 +38,10 @@ export function useVersionComparison(
|
||||
|
||||
setDiff(data as VersionDiff);
|
||||
} catch (err) {
|
||||
console.error('Error fetching version diff:', err);
|
||||
handleError(err, {
|
||||
action: 'Compare Versions',
|
||||
metadata: { entityType, fromVersionId, toVersionId }
|
||||
});
|
||||
setError(err instanceof Error ? err.message : 'Failed to compare versions');
|
||||
setDiff(null);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user