sanifae/src/routes/+layout.js
2023-03-11 12:51:19 -05:00

11 lines
No EOL
310 B
JavaScript

/** @type {import('./$types').PageLoad} */
export async function load({ fetch }) {
const res = await fetch(`/api/token`);
const username = await res.json();
const res2 = await fetch(`/api/messages`);
const read = (await res2.json()).data.read;
return { username: username.data, read };
}