mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 17:11:12 -05:00
Remove real-time updates
This commit is contained in:
@@ -40,57 +40,6 @@ export default function PropertyOwnerDetail() {
|
||||
}
|
||||
}, [slug]);
|
||||
|
||||
// Real-time subscription for parks and photos changes
|
||||
useEffect(() => {
|
||||
if (!owner?.id) return;
|
||||
|
||||
const channel = supabase
|
||||
.channel('owner-stats-changes')
|
||||
.on(
|
||||
'postgres_changes',
|
||||
{
|
||||
event: '*',
|
||||
schema: 'public',
|
||||
table: 'parks',
|
||||
filter: `property_owner_id=eq.${owner.id}`
|
||||
},
|
||||
(payload) => {
|
||||
console.log('Park change detected for owner:', payload);
|
||||
fetchStatistics(owner.id);
|
||||
}
|
||||
)
|
||||
.on(
|
||||
'postgres_changes',
|
||||
{
|
||||
event: 'UPDATE',
|
||||
schema: 'public',
|
||||
table: 'rides'
|
||||
},
|
||||
(payload) => {
|
||||
console.log('Ride status change detected:', payload);
|
||||
fetchStatistics(owner.id);
|
||||
}
|
||||
)
|
||||
.on(
|
||||
'postgres_changes',
|
||||
{
|
||||
event: '*',
|
||||
schema: 'public',
|
||||
table: 'photos',
|
||||
filter: `entity_type=eq.property_owner,entity_id=eq.${owner.id}`
|
||||
},
|
||||
(payload) => {
|
||||
console.log('Photo change detected for owner:', payload);
|
||||
fetchPhotoCount(owner.id);
|
||||
}
|
||||
)
|
||||
.subscribe();
|
||||
|
||||
return () => {
|
||||
supabase.removeChannel(channel);
|
||||
};
|
||||
}, [owner?.id]);
|
||||
|
||||
const fetchOwnerData = async () => {
|
||||
try {
|
||||
const { data, error } = await supabase
|
||||
|
||||
Reference in New Issue
Block a user