mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-04 12:45:17 +02:00
feat: Update map page to fetch GeoJSON data from new endpoint
This commit is contained in:
parent
57eee7bb5d
commit
055290ce3f
2 changed files with 1 additions and 4 deletions
|
@ -14,8 +14,6 @@ export const load = (async (event) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let geoJsonUrl = `${endpoint}/api/geojson/` as string;
|
|
||||||
|
|
||||||
let visitedRegionsFetch = await fetch(`${endpoint}/api/visitedregion/`, {
|
let visitedRegionsFetch = await fetch(`${endpoint}/api/visitedregion/`, {
|
||||||
headers: {
|
headers: {
|
||||||
Cookie: `${event.cookies.get('auth')}`
|
Cookie: `${event.cookies.get('auth')}`
|
||||||
|
@ -44,7 +42,6 @@ export const load = (async (event) => {
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
markers,
|
markers,
|
||||||
geoJsonUrl,
|
|
||||||
visitedRegions
|
visitedRegions
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
$: {
|
$: {
|
||||||
if (showGEO && geoJSON.length === 0) {
|
if (showGEO && geoJSON.length === 0) {
|
||||||
(async () => {
|
(async () => {
|
||||||
geoJSON = await fetch(data.props.geoJsonUrl).then((res) => res.json());
|
geoJSON = await fetch('/api/geojson/').then((res) => res.json());
|
||||||
})();
|
})();
|
||||||
} else if (!showGEO) {
|
} else if (!showGEO) {
|
||||||
geoJSON = [];
|
geoJSON = [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue