mirror of
https://github.com/System-End/daydream-phoenix.git
synced 2026-04-19 20:55:11 +00:00
Fix locaion override
This commit is contained in:
parent
a8779921f8
commit
4b31281c6d
1 changed files with 4 additions and 3 deletions
|
|
@ -29,12 +29,13 @@ export async function load() {
|
|||
// Geocode each event location
|
||||
const locations = [];
|
||||
for (const event of events) {
|
||||
const { location, state, country, event_name, location_override } = event.fields;
|
||||
const { location, state, country, event_name, address_override } = event.fields;
|
||||
|
||||
if (!location || !event_name) continue;
|
||||
|
||||
// Use location_override if set, otherwise build address string
|
||||
const address = location_override || [location, state, country].filter(Boolean).join(', ');
|
||||
// Use address_override if set, otherwise build address string
|
||||
const address = address_override || [location, state, country].filter(Boolean).join(', ');
|
||||
console.log(`${event_name}: ${address}`)
|
||||
|
||||
try {
|
||||
const geocodeUrl = `https://geocoder.hackclub.com/v1/geocode?address=${encodeURIComponent(address)}&key=${GEOCODER_API_KEY}`;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue