diff --git a/app/pages/admin/events/create.vue b/app/pages/admin/events/create.vue index ab373b3..a1e6b75 100644 --- a/app/pages/admin/events/create.vue +++ b/app/pages/admin/events/create.vue @@ -114,7 +114,7 @@

- Enter a video conference link or Slack channel (starting with #) + Video conference link, Slack channel (#channel-name), or 'TBD' if + the platform is undecided

@@ -840,7 +841,7 @@ const validateForm = () => { if (!eventForm.location.trim()) { formErrors.value.push("Location is required"); fieldErrors.value.location = - "Please enter a location (URL or Slack channel)"; + "Please enter a URL, Slack channel, or 'TBD'"; } // Date validation @@ -861,18 +862,17 @@ const validateForm = () => { // Location format validation if (eventForm.location.trim()) { + const value = eventForm.location.trim(); const urlPattern = /^https?:\/\/.+/; const slackPattern = /^#[a-zA-Z0-9-_]+$/; + const isTbd = value.toUpperCase() === "TBD"; - if ( - !urlPattern.test(eventForm.location) && - !slackPattern.test(eventForm.location) - ) { + if (!isTbd && !urlPattern.test(value) && !slackPattern.test(value)) { formErrors.value.push( - "Location must be a valid URL or Slack channel (starting with #)", + "Location must be a valid URL, Slack channel (starting with #), or 'TBD'", ); fieldErrors.value.location = - "Enter a video conference link (https://...) or Slack channel (#channel-name)"; + "Enter a URL (https://...), Slack channel (#channel-name), or 'TBD' if undecided"; } } diff --git a/app/pages/events/[slug].vue b/app/pages/events/[slug].vue index 7f72a67..8dc05d2 100644 --- a/app/pages/events/[slug].vue +++ b/app/pages/events/[slug].vue @@ -22,7 +22,10 @@
Location - {{ event.location }} + + Platform TBD + +
diff --git a/server/models/event.js b/server/models/event.js index ff2e2b0..763b00b 100644 --- a/server/models/event.js +++ b/server/models/event.js @@ -25,13 +25,14 @@ const eventSchema = new mongoose.Schema({ // This will typically be a Slack channel or video conference link validate: { validator: function (v) { - // Must be either a valid URL or a Slack channel reference + // Accept a URL, a Slack channel, or the literal "TBD" (platform undecided). + if (typeof v === "string" && v.trim().toUpperCase() === "TBD") return true; const urlPattern = /^https?:\/\/.+/; const slackPattern = /^#[a-zA-Z0-9-_]+$/; return urlPattern.test(v) || slackPattern.test(v); }, message: - "Location must be a valid URL (video conference link) or Slack channel (starting with #)", + "Location must be a valid URL, Slack channel (starting with #), or 'TBD'", }, }, isOnline: { type: Boolean, default: true }, // Default to online-first