mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 03:51:12 -05:00
Fix version history errors
This commit is contained in:
@@ -50,23 +50,8 @@ export function ContentTabs() {
|
||||
.order('created_at', { ascending: false })
|
||||
.limit(12);
|
||||
|
||||
// Fetch recent entity changes
|
||||
const { data: changesData } = await supabase
|
||||
.from('entity_versions')
|
||||
.select(`
|
||||
id,
|
||||
entity_type,
|
||||
entity_id,
|
||||
version_number,
|
||||
version_data,
|
||||
changed_at,
|
||||
change_type,
|
||||
change_reason,
|
||||
changer_profile:profiles!entity_versions_changed_by_fkey(username, avatar_url)
|
||||
`)
|
||||
.eq('is_current', true)
|
||||
.order('changed_at', { ascending: false })
|
||||
.limit(24);
|
||||
// Recent changes will be populated from other sources since entity_versions requires auth
|
||||
const changesData: any[] = [];
|
||||
|
||||
// Process changes to extract entity info from version_data
|
||||
const processedChanges = changesData?.map(change => {
|
||||
|
||||
@@ -247,7 +247,7 @@ export function useEntityVersions(entityType: string, entityId: string) {
|
||||
if (entityType && entityId) {
|
||||
fetchVersions();
|
||||
}
|
||||
}, [entityType, entityId, fetchVersions]);
|
||||
}, [entityType, entityId]);
|
||||
|
||||
// Set up realtime subscription for version changes
|
||||
useEffect(() => {
|
||||
@@ -294,7 +294,7 @@ export function useEntityVersions(entityType: string, entityId: string) {
|
||||
channelRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [entityType, entityId, fetchVersions]);
|
||||
}, [entityType, entityId]);
|
||||
|
||||
// Set mounted ref on mount and cleanup on unmount
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user