mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 18:11:12 -05:00
Fix 406 errors and realtime timeouts
This commit is contained in:
@@ -48,21 +48,21 @@ async function detectPhotoChanges(submissionId: string): Promise<PhotoChange[]>
|
||||
const changes: PhotoChange[] = [];
|
||||
|
||||
try {
|
||||
// Fetch photo submission with items
|
||||
const { data: photoSubmission, error } = await supabase
|
||||
// Fetch photo submission with items - use array query to avoid 406 errors
|
||||
const { data: photoSubmissions, error } = await supabase
|
||||
.from('photo_submissions')
|
||||
.select(`
|
||||
*,
|
||||
items:photo_submission_items(*)
|
||||
`)
|
||||
.eq('submission_id', submissionId)
|
||||
.maybeSingle();
|
||||
.eq('submission_id', submissionId);
|
||||
|
||||
if (error) {
|
||||
console.error('Error fetching photo submissions:', error);
|
||||
return changes;
|
||||
}
|
||||
|
||||
const photoSubmission = photoSubmissions?.[0];
|
||||
if (photoSubmission?.items && photoSubmission.items.length > 0) {
|
||||
// For now, treat all photos as additions
|
||||
// TODO: Implement edit/delete detection by comparing with existing entity photos
|
||||
|
||||
Reference in New Issue
Block a user