1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-02 19:55:18 +02:00

feat: Update stats API endpoint to include username for personalized user statistics

This commit is contained in:
Sean Morley 2025-02-03 19:57:22 -05:00
parent 9c3a52ae85
commit 8ea8043beb

View file

@ -20,11 +20,14 @@ export const load = (async (event) => {
let stats = null;
let res = await event.fetch(`${serverEndpoint}/api/stats/counts/`, {
headers: {
Cookie: `sessionid=${event.cookies.get('sessionid')}`
let res = await event.fetch(
`${serverEndpoint}/api/stats/counts/${event.locals.user.username}`,
{
headers: {
Cookie: `sessionid=${event.cookies.get('sessionid')}`
}
}
});
);
if (!res.ok) {
console.error('Failed to fetch user stats');
} else {