feat: Update map page to fetch GeoJSON data from new endpoint
This commit is contained in:
@@ -14,8 +14,6 @@ export const load = (async (event) => {
|
||||
}
|
||||
});
|
||||
|
||||
let geoJsonUrl = `${endpoint}/api/geojson/` as string;
|
||||
|
||||
let visitedRegionsFetch = await fetch(`${endpoint}/api/visitedregion/`, {
|
||||
headers: {
|
||||
Cookie: `${event.cookies.get('auth')}`
|
||||
@@ -44,7 +42,6 @@ export const load = (async (event) => {
|
||||
return {
|
||||
props: {
|
||||
markers,
|
||||
geoJsonUrl,
|
||||
visitedRegions
|
||||
}
|
||||
};
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
$: {
|
||||
if (showGEO && geoJSON.length === 0) {
|
||||
(async () => {
|
||||
geoJSON = await fetch(data.props.geoJsonUrl).then((res) => res.json());
|
||||
geoJSON = await fetch('/api/geojson/').then((res) => res.json());
|
||||
})();
|
||||
} else if (!showGEO) {
|
||||
geoJSON = [];
|
||||
|
||||
Reference in New Issue
Block a user