mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 02:31:12 -05:00
Fix build errors in system activity service
This commit is contained in:
@@ -50,14 +50,18 @@ export default function AdminDashboard() {
|
||||
const checkSuspiciousVersions = useCallback(async () => {
|
||||
if (!user || !isModerator()) return;
|
||||
|
||||
const { count, error } = await supabase
|
||||
.from('entity_versions')
|
||||
.select('*', { count: 'exact', head: true })
|
||||
.is('changed_by', null);
|
||||
// Query all version tables for suspicious entries (no changed_by)
|
||||
const queries = [
|
||||
supabase.from('park_versions').select('*', { count: 'exact', head: true }).is('created_by', null),
|
||||
supabase.from('ride_versions').select('*', { count: 'exact', head: true }).is('created_by', null),
|
||||
supabase.from('company_versions').select('*', { count: 'exact', head: true }).is('created_by', null),
|
||||
supabase.from('ride_model_versions').select('*', { count: 'exact', head: true }).is('created_by', null),
|
||||
];
|
||||
|
||||
if (!error && count !== null) {
|
||||
setSuspiciousVersionsCount(count);
|
||||
}
|
||||
const results = await Promise.all(queries);
|
||||
const totalCount = results.reduce((sum, result) => sum + (result.count || 0), 0);
|
||||
|
||||
setSuspiciousVersionsCount(totalCount);
|
||||
}, [user, isModerator]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user