mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 00:31:13 -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[] = [];
|
const changes: PhotoChange[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Fetch photo submission with items
|
// Fetch photo submission with items - use array query to avoid 406 errors
|
||||||
const { data: photoSubmission, error } = await supabase
|
const { data: photoSubmissions, error } = await supabase
|
||||||
.from('photo_submissions')
|
.from('photo_submissions')
|
||||||
.select(`
|
.select(`
|
||||||
*,
|
*,
|
||||||
items:photo_submission_items(*)
|
items:photo_submission_items(*)
|
||||||
`)
|
`)
|
||||||
.eq('submission_id', submissionId)
|
.eq('submission_id', submissionId);
|
||||||
.maybeSingle();
|
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('Error fetching photo submissions:', error);
|
console.error('Error fetching photo submissions:', error);
|
||||||
return changes;
|
return changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const photoSubmission = photoSubmissions?.[0];
|
||||||
if (photoSubmission?.items && photoSubmission.items.length > 0) {
|
if (photoSubmission?.items && photoSubmission.items.length > 0) {
|
||||||
// For now, treat all photos as additions
|
// For now, treat all photos as additions
|
||||||
// TODO: Implement edit/delete detection by comparing with existing entity photos
|
// TODO: Implement edit/delete detection by comparing with existing entity photos
|
||||||
|
|||||||
Reference in New Issue
Block a user