mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 02:31:12 -05:00
Fix frontend JSONB references
This commit is contained in:
@@ -287,7 +287,13 @@ export default function Profile() {
|
||||
// Fetch last 10 submissions with enriched data
|
||||
let submissionsQuery = supabase
|
||||
.from('content_submissions')
|
||||
.select('id, submission_type, content, status, created_at')
|
||||
.select(`
|
||||
id,
|
||||
submission_type,
|
||||
status,
|
||||
created_at,
|
||||
submission_metadata(name)
|
||||
`)
|
||||
.eq('user_id', userId)
|
||||
.order('created_at', { ascending: false })
|
||||
.limit(10);
|
||||
@@ -305,6 +311,12 @@ export default function Profile() {
|
||||
const enrichedSubmissions = await Promise.all((submissions || []).map(async (sub) => {
|
||||
const enriched: any = { ...sub };
|
||||
|
||||
// Get name from submission_metadata
|
||||
const metadata = sub.submission_metadata as any;
|
||||
enriched.name = Array.isArray(metadata) && metadata.length > 0
|
||||
? metadata[0]?.name
|
||||
: undefined;
|
||||
|
||||
// For photo submissions, get photo count and preview
|
||||
if (sub.submission_type === 'photo') {
|
||||
const { data: photoSubs } = await supabase
|
||||
|
||||
Reference in New Issue
Block a user