mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 17:11:12 -05:00
Fix submission flow for street address
Update submission and moderation pipeline to correctly handle `street_address`. This includes: - Adding `street_address` to the Zod schema in `ParkForm.tsx`. - Ensuring `street_address` is included in `tempLocationData` for park and composite park creations in `entitySubmissionHelpers.ts`. - Preserving `street_address` when editing submissions in `submissionItemsService.ts`. - Saving `street_address` when new locations are created during submission approval in `submissionItemsService.ts`.
This commit is contained in:
@@ -712,6 +712,7 @@ async function resolveLocationId(locationData: any): Promise<string | null> {
|
||||
.from('locations')
|
||||
.insert({
|
||||
name: locationData.name,
|
||||
street_address: locationData.street_address || null,
|
||||
city: locationData.city || null,
|
||||
state_province: locationData.state_province || null,
|
||||
country: locationData.country,
|
||||
@@ -1477,6 +1478,7 @@ export async function editSubmissionItem(
|
||||
if (newData.location) {
|
||||
updateData.temp_location_data = {
|
||||
name: newData.location.name,
|
||||
street_address: newData.location.street_address || null,
|
||||
city: newData.location.city || null,
|
||||
state_province: newData.location.state_province || null,
|
||||
country: newData.location.country,
|
||||
|
||||
Reference in New Issue
Block a user