feat: Add location_name to ReverseGeocode type and implement location fetching in stats view

This commit is contained in:
Sean Morley
2025-02-15 19:44:11 -05:00
parent 60b5bbb3c8
commit b5d6788c11
21 changed files with 1048 additions and 901 deletions

View File

@@ -11,6 +11,19 @@ const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
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();
return {
props: {
locations: data
}
};
}
}) satisfies PageServerLoad;