web: add more cards to overview

This commit is contained in:
Jens Langhammer
2020-12-01 12:41:37 +01:00
parent 93bfe60369
commit 7bb26b5903
2 changed files with 66 additions and 4 deletions

View File

@ -1,5 +1,4 @@
import { Primitive } from "lit-html/lib/parts";
import { DefaultClient } from "./client";
import { DefaultClient, PBResponse } from "./client";
export class User {
pk?: number;
@ -12,4 +11,12 @@ export class User {
static me(): Promise<User> {
return DefaultClient.fetch<User>(["core", "users", "me"]);
}
static count(): Promise<number> {
return DefaultClient.fetch<PBResponse<User>>(["core", "users"], {
"page_size": 1
}).then(r => {
return r.pagination.count;
});
}
}