Fix 406 errors and realtime auth

This commit is contained in:
gpt-engineer-app[bot]
2025-10-03 17:17:40 +00:00
parent 98688f1821
commit 08b842052a
3 changed files with 16 additions and 7 deletions

View File

@@ -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');