chore(frontend): clean up imports + packages

This commit is contained in:
Sam 2023-03-21 15:32:51 +01:00
parent cafebec8ec
commit f790c57447
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
12 changed files with 14 additions and 355 deletions

View file

@ -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,
};

View file

@ -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>

View file

@ -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>