web/admin: migrate api calls to async (#4335)
migrate api calls to async Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -16,7 +16,7 @@ export class AdminModelPerDay extends AKChart<Coordinate[]> {
|
||||
@property({ attribute: false })
|
||||
query?: { [key: string]: unknown } | undefined;
|
||||
|
||||
apiRequest(): Promise<Coordinate[]> {
|
||||
async apiRequest(): Promise<Coordinate[]> {
|
||||
return new EventsApi(DEFAULT_CONFIG).eventsEventsPerMonthList({
|
||||
action: this.action,
|
||||
query: JSON.stringify(this.query || {}),
|
||||
|
||||
@ -13,7 +13,7 @@ export class ApplicationAuthorizeChart extends AKChart<Coordinate[]> {
|
||||
@property()
|
||||
applicationSlug!: string;
|
||||
|
||||
apiRequest(): Promise<Coordinate[]> {
|
||||
async apiRequest(): Promise<Coordinate[]> {
|
||||
return new CoreApi(DEFAULT_CONFIG).coreApplicationsMetricsList({
|
||||
slug: this.applicationSlug,
|
||||
});
|
||||
|
||||
@ -13,7 +13,7 @@ export class UserChart extends AKChart<UserMetrics> {
|
||||
@property({ type: Number })
|
||||
userId?: number;
|
||||
|
||||
apiRequest(): Promise<UserMetrics> {
|
||||
async apiRequest(): Promise<UserMetrics> {
|
||||
return new CoreApi(DEFAULT_CONFIG).coreUsersMetricsRetrieve({
|
||||
id: this.userId || 0,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user