Remove real-time updates

This commit is contained in:
gpt-engineer-app[bot]
2025-10-10 13:05:22 +00:00
parent 61c7a551c2
commit c0cc91a0dd
2 changed files with 0 additions and 102 deletions

View File

@@ -40,57 +40,6 @@ export default function OperatorDetail() {
}
}, [slug]);
// Real-time subscription for parks, rides, and photos changes
useEffect(() => {
if (!operator?.id) return;
const channel = supabase
.channel('operator-stats-changes')
.on(
'postgres_changes',
{
event: '*',
schema: 'public',
table: 'parks',
filter: `operator_id=eq.${operator.id}`
},
(payload) => {
console.log('Park change detected for operator:', payload);
fetchStatistics(operator.id);
}
)
.on(
'postgres_changes',
{
event: 'UPDATE',
schema: 'public',
table: 'rides'
},
(payload) => {
console.log('Ride status change detected:', payload);
fetchStatistics(operator.id);
}
)
.on(
'postgres_changes',
{
event: '*',
schema: 'public',
table: 'photos',
filter: `entity_type=eq.operator,entity_id=eq.${operator.id}`
},
(payload) => {
console.log('Photo change detected for operator:', payload);
fetchPhotoCount(operator.id);
}
)
.subscribe();
return () => {
supabase.removeChannel(channel);
};
}, [operator?.id]);
const fetchOperatorData = async () => {
try {
const { data, error } = await supabase

View File

@@ -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