mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-04 04:35:19 +02:00
feat: Update stats API endpoint to include username for personalized user statistics
This commit is contained in:
parent
9c3a52ae85
commit
8ea8043beb
1 changed files with 7 additions and 4 deletions
|
@ -20,11 +20,14 @@ export const load = (async (event) => {
|
||||||
|
|
||||||
let stats = null;
|
let stats = null;
|
||||||
|
|
||||||
let res = await event.fetch(`${serverEndpoint}/api/stats/counts/`, {
|
let res = await event.fetch(
|
||||||
|
`${serverEndpoint}/api/stats/counts/${event.locals.user.username}`,
|
||||||
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Cookie: `sessionid=${event.cookies.get('sessionid')}`
|
Cookie: `sessionid=${event.cookies.get('sessionid')}`
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
console.error('Failed to fetch user stats');
|
console.error('Failed to fetch user stats');
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue