add get_username method on client

This commit is contained in:
mbecker20
2023-01-01 21:18:24 +00:00
parent a927571e29
commit d5861274de
2 changed files with 10 additions and 3 deletions

View File

@@ -18,8 +18,9 @@ const Summary: Component<{}> = (p) => {
<h1>summary</h1>
<Flex gap="1rem" justifyContent="flex-end" class="wrap">
<Grid
placeItems="center end"
placeItems="start end"
class={combineClasses(s.SummaryItem, "shadow")}
gap="0.5rem"
>
<h2>servers</h2>
<Flex gap="0.4rem">
@@ -40,8 +41,9 @@ const Summary: Component<{}> = (p) => {
</Flex>
</Grid>
<Grid
placeItems="center end"
placeItems="start end"
class={combineClasses(s.SummaryItem, "shadow")}
gap="0.5rem"
>
<h2>deployments</h2>
<Flex gap="0.4rem">
@@ -68,8 +70,9 @@ const Summary: Component<{}> = (p) => {
</Flex>
</Grid>
<Grid
placeItems="center end"
placeItems="start end"
class={combineClasses(s.SummaryItem, "shadow")}
gap="0.5rem"
>
<h2>builds</h2>
<Flex gap="0.4rem">

View File

@@ -99,6 +99,10 @@ export class Client {
}
}
async get_username(user_id: string): Promise<string> {
return this.get(`/api/username/${user_id}`);
}
exchange_for_jwt(exchange_token: string): Promise<string> {
return this.post("/auth/exchange", { token: exchange_token });
}