diff --git a/backend/server/adventures/views/stats_view.py b/backend/server/adventures/views/stats_view.py index da2146a..37d9f07 100644 --- a/backend/server/adventures/views/stats_view.py +++ b/backend/server/adventures/views/stats_view.py @@ -48,11 +48,4 @@ class StatsViewSet(viewsets.ViewSet): 'total_regions': total_regions, 'visited_country_count': visited_country_count, 'total_countries': total_countries - }) - - # locations - returns a list of all of the latitude, longitude locations of all public adventrues on the server - @action(detail=False, methods=['get'], url_path='locations') - def locations(self, request): - adventures = Adventure.objects.filter( - is_public=True).values('latitude', 'longitude', 'id', 'name') - return Response(adventures) \ No newline at end of file + }) \ No newline at end of file diff --git a/frontend/src/routes/+page.server.ts b/frontend/src/routes/+page.server.ts index 221b103..2e441db 100644 --- a/frontend/src/routes/+page.server.ts +++ b/frontend/src/routes/+page.server.ts @@ -2,7 +2,7 @@ const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL']; import { redirect, type Actions } from '@sveltejs/kit'; // @ts-ignore import psl from 'psl'; -import { themes } from '$lib'; +import { getRandomBackground, themes } from '$lib'; import { fetchCSRFToken } from '$lib/index.server'; import type { PageServerLoad } from './$types'; @@ -12,16 +12,10 @@ export const load = (async (event) => { if (event.locals.user) { return redirect(302, '/dashboard'); } else { - let res = await fetch(`${serverEndpoint}/api/stats/locations/`, { - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }); - let data = await res.json(); + const background = getRandomBackground(); return { props: { - locations: data + background } }; } diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 1b3cd2e..b67404a 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -1,13 +1,13 @@ @@ -58,35 +58,11 @@
-