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:
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 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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue