mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 03:11:12 -05:00
Fix build errors and complete transformation
This commit is contained in:
@@ -88,32 +88,14 @@ export function useEntityVersions(entityType: EntityType, entityId: string) {
|
||||
}
|
||||
}, [entityType, entityId]);
|
||||
|
||||
/**
|
||||
* Field history has been removed - use version comparison instead
|
||||
* This function is kept for backward compatibility but does nothing
|
||||
* @deprecated Use compareVersions() to see field-level changes
|
||||
*/
|
||||
const fetchFieldHistory = async (versionId: string) => {
|
||||
if (!isMountedRef.current) return;
|
||||
|
||||
const currentRequestId = ++fieldHistoryRequestCounterRef.current;
|
||||
|
||||
try {
|
||||
const { data, error } = await supabase
|
||||
.from('entity_field_history')
|
||||
.select('*')
|
||||
.eq('version_id', versionId)
|
||||
.order('created_at', { ascending: false });
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
if (isMountedRef.current && currentRequestId === fieldHistoryRequestCounterRef.current) {
|
||||
const fieldChanges = Array.isArray(data) ? data as FieldChange[] : [];
|
||||
setFieldHistory(fieldChanges);
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('Error fetching field history:', error);
|
||||
|
||||
if (isMountedRef.current && currentRequestId === fieldHistoryRequestCounterRef.current) {
|
||||
const errorMessage = error?.message || 'Failed to load field history';
|
||||
toast.error(errorMessage);
|
||||
}
|
||||
}
|
||||
console.warn('fetchFieldHistory is deprecated. Use compareVersions() instead for field-level changes.');
|
||||
setFieldHistory([]);
|
||||
};
|
||||
|
||||
const compareVersions = async (fromVersionId: string, toVersionId: string) => {
|
||||
|
||||
Reference in New Issue
Block a user