mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 10:51:13 -05:00
Fix 406 errors and realtime auth
This commit is contained in:
@@ -41,19 +41,18 @@ export function SubmissionItemsList({
|
||||
|
||||
if (itemsError) throw itemsError;
|
||||
|
||||
// Check for photo submissions
|
||||
// Check for photo submissions (using array query to avoid 406)
|
||||
const { data: photoData, error: photoError } = await supabase
|
||||
.from('photo_submissions')
|
||||
.select('id')
|
||||
.eq('submission_id', submissionId)
|
||||
.single();
|
||||
.eq('submission_id', submissionId);
|
||||
|
||||
if (photoError && photoError.code !== 'PGRST116') {
|
||||
if (photoError) {
|
||||
console.warn('Error checking photo submissions:', photoError);
|
||||
}
|
||||
|
||||
setItems((itemsData || []) as SubmissionItemData[]);
|
||||
setHasPhotos(!!photoData);
|
||||
setHasPhotos(photoData && photoData.length > 0);
|
||||
} catch (err) {
|
||||
console.error('Error fetching submission items:', err);
|
||||
setError('Failed to load submission details');
|
||||
|
||||
Reference in New Issue
Block a user