mirror of
https://github.com/Such-Software/smirk-website.git
synced 2026-11-13 09:14:03 +01:00
Feat: add stats page
This commit is contained in:
@@ -406,3 +406,24 @@ export async function getUserCount(): Promise<UserCountResponse> {
|
||||
|
||||
return res.json();
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Public Stats
|
||||
// =============================================================================
|
||||
|
||||
export interface PublicStats {
|
||||
total_users: number;
|
||||
users_by_preferred_asset: Record<string, number>;
|
||||
linked_accounts_by_platform: Record<string, number>;
|
||||
total_tips_sent: number;
|
||||
}
|
||||
|
||||
export async function getPublicStats(): Promise<PublicStats> {
|
||||
const res = await fetch(`${API_URL}/api/v1/stats/public`);
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error('Failed to get stats');
|
||||
}
|
||||
|
||||
return res.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user