mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 04:51:13 -05:00
Refactor: Implement complete plan
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user