mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-28 10:06:58 -05:00
Compare commits
2 Commits
fc7c2d5adc
...
9f5240ae95
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f5240ae95 | ||
|
|
9159b2ce89 |
@@ -43,6 +43,7 @@ const parkSchema = z.object({
|
|||||||
closing_date_precision: z.enum(['day', 'month', 'year']).optional(),
|
closing_date_precision: z.enum(['day', 'month', 'year']).optional(),
|
||||||
location: z.object({
|
location: z.object({
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
|
street_address: z.string().optional(),
|
||||||
city: z.string().optional(),
|
city: z.string().optional(),
|
||||||
state_province: z.string().optional(),
|
state_province: z.string().optional(),
|
||||||
country: z.string(),
|
country: z.string(),
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ export interface ParkFormData {
|
|||||||
// Location can be stored as object for new submissions or ID for editing
|
// Location can be stored as object for new submissions or ID for editing
|
||||||
location?: {
|
location?: {
|
||||||
name: string;
|
name: string;
|
||||||
|
street_address?: string;
|
||||||
city?: string;
|
city?: string;
|
||||||
state_province?: string;
|
state_province?: string;
|
||||||
country: string;
|
country: string;
|
||||||
@@ -351,6 +352,7 @@ async function submitCompositeCreation(
|
|||||||
if (uploadedPrimary.type === 'park' && uploadedPrimary.data.location) {
|
if (uploadedPrimary.type === 'park' && uploadedPrimary.data.location) {
|
||||||
primaryData.temp_location_data = {
|
primaryData.temp_location_data = {
|
||||||
name: uploadedPrimary.data.location.name,
|
name: uploadedPrimary.data.location.name,
|
||||||
|
street_address: uploadedPrimary.data.location.street_address || null,
|
||||||
city: uploadedPrimary.data.location.city || null,
|
city: uploadedPrimary.data.location.city || null,
|
||||||
state_province: uploadedPrimary.data.location.state_province || null,
|
state_province: uploadedPrimary.data.location.state_province || null,
|
||||||
country: uploadedPrimary.data.location.country,
|
country: uploadedPrimary.data.location.country,
|
||||||
@@ -694,6 +696,7 @@ export async function submitParkCreation(
|
|||||||
// Insert into relational park_submissions table
|
// Insert into relational park_submissions table
|
||||||
const tempLocationData = data.location ? {
|
const tempLocationData = data.location ? {
|
||||||
name: data.location.name,
|
name: data.location.name,
|
||||||
|
street_address: data.location.street_address || null,
|
||||||
city: data.location.city || null,
|
city: data.location.city || null,
|
||||||
state_province: data.location.state_province || null,
|
state_province: data.location.state_province || null,
|
||||||
country: data.location.country,
|
country: data.location.country,
|
||||||
|
|||||||
@@ -712,6 +712,7 @@ async function resolveLocationId(locationData: any): Promise<string | null> {
|
|||||||
.from('locations')
|
.from('locations')
|
||||||
.insert({
|
.insert({
|
||||||
name: locationData.name,
|
name: locationData.name,
|
||||||
|
street_address: locationData.street_address || null,
|
||||||
city: locationData.city || null,
|
city: locationData.city || null,
|
||||||
state_province: locationData.state_province || null,
|
state_province: locationData.state_province || null,
|
||||||
country: locationData.country,
|
country: locationData.country,
|
||||||
@@ -1477,6 +1478,7 @@ export async function editSubmissionItem(
|
|||||||
if (newData.location) {
|
if (newData.location) {
|
||||||
updateData.temp_location_data = {
|
updateData.temp_location_data = {
|
||||||
name: newData.location.name,
|
name: newData.location.name,
|
||||||
|
street_address: newData.location.street_address || null,
|
||||||
city: newData.location.city || null,
|
city: newData.location.city || null,
|
||||||
state_province: newData.location.state_province || null,
|
state_province: newData.location.state_province || null,
|
||||||
country: newData.location.country,
|
country: newData.location.country,
|
||||||
|
|||||||
@@ -1556,6 +1556,7 @@ async function createPark(supabase: any, data: any): Promise<string> {
|
|||||||
.from('locations')
|
.from('locations')
|
||||||
.insert({
|
.insert({
|
||||||
name: data.temp_location_data.name,
|
name: data.temp_location_data.name,
|
||||||
|
street_address: data.temp_location_data.street_address || null,
|
||||||
city: data.temp_location_data.city,
|
city: data.temp_location_data.city,
|
||||||
state_province: data.temp_location_data.state_province,
|
state_province: data.temp_location_data.state_province,
|
||||||
country: data.temp_location_data.country,
|
country: data.temp_location_data.country,
|
||||||
|
|||||||
Reference in New Issue
Block a user