fix: location missing field error

This commit is contained in:
Levente Orban
2025-09-25 09:28:44 +02:00
parent d2024d31ba
commit 26824eb3a8
12 changed files with 161 additions and 117 deletions

View File

@@ -17,7 +17,7 @@ import type { InferInsertModel, InferSelectModel } from 'drizzle-orm';
// --- Enums (matching the SQL CHECK constraints)
export const eventTypeEnum = pgEnum('event_type', ['limited', 'unlimited']);
export const visibilityEnum = pgEnum('visibility', ['public', 'private']);
export const locationTypeEnum = pgEnum('location_type', ['text', 'maps']);
export const locationTypeEnum = pgEnum('location_type', ['none', 'text', 'maps']);
// --- Events table
export const events = pgTable(
@@ -28,7 +28,7 @@ export const events = pgTable(
date: date('date', { mode: 'string' }).notNull(), // ISO 'YYYY-MM-DD'
time: time('time', { withTimezone: false }).notNull(), // 'HH:MM:SS'
location: varchar('location', { length: 200 }).notNull(),
locationType: locationTypeEnum('location_type').notNull().default('text'),
locationType: locationTypeEnum('location_type').notNull().default('none'),
locationUrl: varchar('location_url', { length: 500 }),
type: eventTypeEnum('type').notNull(),
attendeeLimit: integer('attendee_limit'), // nullable in SQL

View File

@@ -15,8 +15,10 @@
"time": "Time",
"location": "Location",
"locationType": "Location Type",
"locationNone": "None",
"locationText": "Text",
"locationMaps": "Google Maps",
"locationNoneDescription": "No location specified",
"locationTextDescription": "Enter location as plain text.",
"locationMapsDescription": "Enter Google Maps link.",
"googleMapsUrl": "Google Maps URL",
@@ -142,10 +144,12 @@
"locationLabel": "Location",
"locationPlaceholder": "Enter location",
"locationTypeLabel": "Location Type",
"locationNoneOption": "None",
"locationTextOption": "Plain Text",
"locationMapsOption": "Google Maps",
"locationTextDescription": "Enter location as plain text",
"locationMapsDescription": "Enter Google Maps link",
"locationNoneDescription": "No location specified.",
"locationTextDescription": "Enter location as plain text.",
"locationMapsDescription": "Enter Google Maps link.",
"googleMapsUrlLabel": "Google Maps URL",
"googleMapsUrlPlaceholder": "https://maps.google.com/...",
"typeLabel": "Type",
@@ -156,8 +160,8 @@
"visibilityLabel": "Visibility",
"publicOption": "🌍 Public",
"privateOption": "🔒 Private",
"publicDescription": "Public events are visible to everyone and can be discovered by others",
"privateDescription": "Private events are only visible to you and people you share the link with",
"publicDescription": "Public events are visible to everyone and can be discovered by others.",
"privateDescription": "Private events are only visible to you and people you share the link with.",
"creatingEvent": "Creating Event...",
"createEventButton": "Create Event"
},

View File

@@ -1,7 +1,7 @@
export type EventType = 'limited' | 'unlimited';
export type EventVisibility = 'public' | 'private';
export type ActionType = 'add' | 'remove';
export type LocationType = 'text' | 'maps';
export type LocationType = 'none' | 'text' | 'maps';
export interface Event {
id: string;