Basic user stats in the accounts page (#1158)

Closes #747
Blocked by #1156 #1166

Very simplistic, not much styling
This commit is contained in:
AbdBarho
2023-02-07 08:10:35 +09:00
committed by GitHub
parent cf4c8e70ce
commit 0ef36e81be
4 changed files with 108 additions and 8 deletions
+5
View File
@@ -307,4 +307,9 @@ export class OasstApiClient {
const backendUser = await this.post<BackendUser>(`/api/v1/frontend_users/`, user);
await this.put<void>(`/api/v1/users/${backendUser.user_id}?tos_acceptance=true`);
}
async fetch_user_stats(user: BackendUserCore) {
const backendUser = await this.get<BackendUser>(`/api/v1/frontend_users/${user.auth_method}/${user.id}`);
return this.get(`/api/v1/users/${backendUser.user_id}/stats`);
}
}