Refactor: Implement complete plan

This commit is contained in:
gpt-engineer-app[bot]
2025-10-17 14:04:57 +00:00
parent a89a740611
commit a2e05c5080
10 changed files with 258 additions and 68 deletions

View File

@@ -41,8 +41,8 @@ export function useEntityVersions(entityType: EntityType, entityId: string) {
const versionTable = `${entityType}_versions`;
const entityIdCol = `${entityType}_id`;
const { data, error } = await supabase
.from(versionTable as any)
const { data, error } = await (supabase as any)
.from(versionTable)
.select(`
*,
profiles:created_by(username, display_name, avatar_url)
@@ -63,7 +63,7 @@ export function useEntityVersions(entityType: EntityType, entityId: string) {
return;
}
const versionsWithProfiles = (data as any[]).map((v: any) => ({
const versionsWithProfiles = (data || []).map((v: any) => ({
...v,
profiles: v.profiles || {
username: 'Unknown',