Add location override

This commit is contained in:
Gus Ruben 2025-07-31 15:25:48 -04:00
parent 416bddd143
commit a8779921f8

View file

@ -29,13 +29,12 @@ export async function load() {
// Geocode each event location
const locations = [];
for (const event of events) {
const { location, state, country, event_name } = event.fields;
const { location, state, country, event_name, location_override } = event.fields;
if (!location || !event_name) continue;
// Build address string
const addressParts = [location, state, country].filter(Boolean);
const address = addressParts.join(', ');
// Use location_override if set, otherwise build address string
const address = location_override || [location, state, country].filter(Boolean).join(', ');
try {
const geocodeUrl = `https://geocoder.hackclub.com/v1/geocode?address=${encodeURIComponent(address)}&key=${GEOCODER_API_KEY}`;