Implement API improvements Phases 1-4

This commit is contained in:
gpt-engineer-app[bot]
2025-10-31 12:33:27 +00:00
parent ca9aa757ae
commit c70c5a4150
13 changed files with 214 additions and 119 deletions

View File

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