mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-20 04:54:18 +02:00
working on the frontend
This commit is contained in:
16
web/src/routes/dashboard/+layout.ts
Normal file
16
web/src/routes/dashboard/+layout.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import {env} from "$env/dynamic/public";
|
||||
import type {LayoutLoad} from "./$types";
|
||||
|
||||
let apiUrl = env.PUBLIC_API_URL
|
||||
|
||||
export const load: LayoutLoad = async ({fetch}) => {
|
||||
const response = await fetch(apiUrl + "/users/me", {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
credentials: 'include',
|
||||
});
|
||||
return {user: await response.json()};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user