mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 17:31:13 -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
|
||||
|
||||
@@ -24,7 +24,16 @@ export default function ErrorLookup() {
|
||||
// Search by partial or full request ID
|
||||
const { data, error } = await supabase
|
||||
.from('request_metadata')
|
||||
.select('*')
|
||||
.select(`
|
||||
*,
|
||||
request_breadcrumbs(
|
||||
timestamp,
|
||||
category,
|
||||
message,
|
||||
level,
|
||||
sequence_order
|
||||
)
|
||||
`)
|
||||
.ilike('request_id', `${errorId}%`)
|
||||
.not('error_type', 'is', null)
|
||||
.limit(1)
|
||||
|
||||
@@ -31,7 +31,16 @@ export default function ErrorMonitoring() {
|
||||
|
||||
let query = supabase
|
||||
.from('request_metadata')
|
||||
.select('*')
|
||||
.select(`
|
||||
*,
|
||||
request_breadcrumbs(
|
||||
timestamp,
|
||||
category,
|
||||
message,
|
||||
level,
|
||||
sequence_order
|
||||
)
|
||||
`)
|
||||
.not('error_type', 'is', null)
|
||||
.gte('created_at', `now() - interval '${dateMap[dateRange]}'`)
|
||||
.order('created_at', { ascending: false })
|
||||
|
||||
Reference in New Issue
Block a user