mirror of
https://github.com/System-End/daydream-phoenix.git
synced 2026-04-19 20:55:11 +00:00
Add location override
This commit is contained in:
parent
416bddd143
commit
a8779921f8
1 changed files with 3 additions and 4 deletions
|
|
@ -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}`;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue