mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:31:13 -05:00
Show all system activity history in admin logs
Modify fetchSystemActivities to retrieve all versions from park, ride, company, and ride_model tables instead of only current versions, and adjust limit logic for better historical data display. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 14a3da17-c084-4611-919e-f0651a496ef3 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7cdf4e95-3f41-4180-b8e3-8ef56d032c0e/14a3da17-c084-4611-919e-f0651a496ef3/cWpfk79
This commit is contained in:
4
.replit
4
.replit
@@ -45,3 +45,7 @@ externalPort = 3001
|
||||
[[ports]]
|
||||
localPort = 37623
|
||||
externalPort = 3002
|
||||
|
||||
[[ports]]
|
||||
localPort = 44381
|
||||
externalPort = 3003
|
||||
|
||||
@@ -207,31 +207,28 @@ export async function fetchSystemActivities(
|
||||
|
||||
// Fetch entity versions from relational version tables
|
||||
// Query all four version tables in parallel for better performance
|
||||
// Fetch ALL versions (not just current) to show complete history
|
||||
const versionQueries = [
|
||||
supabase
|
||||
.from('park_versions')
|
||||
.select('version_id, park_id, version_number, name, created_by, created_at, change_type, change_reason, is_current')
|
||||
.eq('is_current', true)
|
||||
.order('created_at', { ascending: false })
|
||||
.limit(Math.ceil(limit / 2)),
|
||||
.limit(limit),
|
||||
supabase
|
||||
.from('ride_versions')
|
||||
.select('version_id, ride_id, version_number, name, created_by, created_at, change_type, change_reason, is_current')
|
||||
.eq('is_current', true)
|
||||
.order('created_at', { ascending: false })
|
||||
.limit(Math.ceil(limit / 2)),
|
||||
.limit(limit),
|
||||
supabase
|
||||
.from('company_versions')
|
||||
.select('version_id, company_id, version_number, name, created_by, created_at, change_type, change_reason, is_current')
|
||||
.eq('is_current', true)
|
||||
.order('created_at', { ascending: false })
|
||||
.limit(Math.ceil(limit / 4)),
|
||||
.limit(Math.ceil(limit / 2)),
|
||||
supabase
|
||||
.from('ride_model_versions')
|
||||
.select('version_id, ride_model_id, version_number, name, created_by, created_at, change_type, change_reason, is_current')
|
||||
.eq('is_current', true)
|
||||
.order('created_at', { ascending: false })
|
||||
.limit(Math.ceil(limit / 4)),
|
||||
.limit(Math.ceil(limit / 2)),
|
||||
];
|
||||
|
||||
const [parkVersions, rideVersions, companyVersions, modelVersions] = await Promise.all(versionQueries);
|
||||
|
||||
Reference in New Issue
Block a user