mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 16:31:13 -05:00
Fix duplicate variable name
This commit is contained in:
@@ -501,7 +501,7 @@ Deno.serve(async (req) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create submission_item using type-specific foreign keys
|
// Create submission_item using type-specific foreign keys
|
||||||
const itemData: any = {
|
const submissionItemData: any = {
|
||||||
id: itemId,
|
id: itemId,
|
||||||
submission_id: submissionId,
|
submission_id: submissionId,
|
||||||
item_type: type,
|
item_type: type,
|
||||||
@@ -512,18 +512,18 @@ Deno.serve(async (req) => {
|
|||||||
|
|
||||||
// Add the appropriate foreign key based on type
|
// Add the appropriate foreign key based on type
|
||||||
if (type === 'park') {
|
if (type === 'park') {
|
||||||
itemData.park_submission_id = typeDataId;
|
submissionItemData.park_submission_id = typeDataId;
|
||||||
} else if (type === 'ride') {
|
} else if (type === 'ride') {
|
||||||
itemData.ride_submission_id = typeDataId;
|
submissionItemData.ride_submission_id = typeDataId;
|
||||||
} else if (['manufacturer', 'operator', 'designer', 'property_owner'].includes(type)) {
|
} else if (['manufacturer', 'operator', 'designer', 'property_owner'].includes(type)) {
|
||||||
itemData.company_submission_id = typeDataId;
|
submissionItemData.company_submission_id = typeDataId;
|
||||||
} else if (type === 'ride_model') {
|
} else if (type === 'ride_model') {
|
||||||
itemData.ride_model_submission_id = typeDataId;
|
submissionItemData.ride_model_submission_id = typeDataId;
|
||||||
} else if (type === 'photo') {
|
} else if (type === 'photo') {
|
||||||
itemData.photo_submission_id = typeDataId;
|
submissionItemData.photo_submission_id = typeDataId;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { error: itemError } = await supabase.from('submission_items').insert(itemData);
|
const { error: itemError } = await supabase.from('submission_items').insert(submissionItemData);
|
||||||
|
|
||||||
if (itemError) {
|
if (itemError) {
|
||||||
edgeLogger.error('Error inserting submission_item', { type, error: itemError.message });
|
edgeLogger.error('Error inserting submission_item', { type, error: itemError.message });
|
||||||
|
|||||||
Reference in New Issue
Block a user