chore(frontend): clean up imports + packages
This commit is contained in:
parent
cafebec8ec
commit
f790c57447
12 changed files with 14 additions and 355 deletions
|
@ -1,10 +1,4 @@
|
|||
import {
|
||||
ErrorCode,
|
||||
type APIError,
|
||||
type Invite,
|
||||
type MeUser,
|
||||
type PartialMember,
|
||||
} from "$lib/api/entities";
|
||||
import { ErrorCode, type APIError, type Invite, type MeUser } from "$lib/api/entities";
|
||||
import { apiFetchClient } from "$lib/api/fetch";
|
||||
import type { LayoutLoad } from "./$types";
|
||||
|
||||
|
@ -12,7 +6,6 @@ export const ssr = false;
|
|||
|
||||
export const load = (async ({ parent }) => {
|
||||
const user = await apiFetchClient<MeUser>("/users/@me");
|
||||
const members = await apiFetchClient<PartialMember[]>("/users/@me/members");
|
||||
|
||||
let invites: Invite[] = [];
|
||||
let invitesEnabled = true;
|
||||
|
@ -29,7 +22,6 @@ export const load = (async ({ parent }) => {
|
|||
return {
|
||||
...data,
|
||||
user,
|
||||
members,
|
||||
invites,
|
||||
invitesEnabled,
|
||||
};
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Members</th>
|
||||
<td>{data.members.length}/{MAX_MEMBERS}</td>
|
||||
<td>{data.user.members.length}/{MAX_MEMBERS}</td>
|
||||
</tr>
|
||||
{#if data.invitesEnabled}
|
||||
<tr>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
export let data: PageData;
|
||||
|
||||
import * as jose from "jose";
|
||||
const claims = jose.decodeJwt(localStorage.getItem("pronouns-token")!);
|
||||
import { decodeJwt } from "jose";
|
||||
const claims = decodeJwt(localStorage.getItem("pronouns-token")!);
|
||||
</script>
|
||||
|
||||
<h1>Tokens ({data.tokens.length})</h1>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue