mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 16:11:12 -05:00
Implement API improvements Phases 1-4
This commit is contained in:
@@ -57,8 +57,22 @@ export function useHomepageRecentChanges(
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
interface DatabaseRecentChange {
|
||||
entity_id: string;
|
||||
entity_name: string;
|
||||
entity_type: string;
|
||||
entity_slug: string;
|
||||
park_slug?: string;
|
||||
image_url?: string;
|
||||
change_type: string;
|
||||
changed_at: string;
|
||||
changed_by_username?: string;
|
||||
changed_by_avatar?: string;
|
||||
change_reason?: string;
|
||||
}
|
||||
|
||||
// Transform the database response to match our interface
|
||||
const result: RecentChange[] = (data || []).map((item: any) => ({
|
||||
const result: RecentChange[] = (data as unknown as DatabaseRecentChange[] || []).map((item) => ({
|
||||
id: item.entity_id,
|
||||
name: item.entity_name,
|
||||
type: item.entity_type as 'park' | 'ride' | 'company',
|
||||
|
||||
Reference in New Issue
Block a user