2023-01-30 16:17:58 -05:00
|
|
|
/** @type {import('./$types').PageLoad} */
|
2023-02-03 21:54:01 -05:00
|
|
|
export async function load({ fetch }) {
|
|
|
|
const res = await fetch(`/api/token`);
|
|
|
|
|
|
|
|
const username = await res.json();
|
|
|
|
|
2023-03-11 12:51:19 -05:00
|
|
|
const res2 = await fetch(`/api/messages`);
|
|
|
|
const read = (await res2.json()).data.read;
|
|
|
|
|
|
|
|
return { username: username.data, read };
|
2023-01-30 16:17:58 -05:00
|
|
|
}
|