aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/api
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2025-10-28 11:28:56 +0400
committerGitHub <noreply@github.com>2025-10-28 10:28:56 +0300
commitfa723fb81bb8af91b38a055b1e21c3afc019c5a1 (patch)
tree1557715d7b2cba51ec1cf037ff66324b9e978cfb /frontend/src/api
parentfix/backend: have timeline start at the start of the year (#295) (diff)
downloadlphub-fa723fb81bb8af91b38a055b1e21c3afc019c5a1.tar.gz
lphub-fa723fb81bb8af91b38a055b1e21c3afc019c5a1.tar.bz2
lphub-fa723fb81bb8af91b38a055b1e21c3afc019c5a1.zip
feat/frontend: add dates to recent scores in homepage (#296)
Diffstat (limited to 'frontend/src/api')
-rw-r--r--frontend/src/api/Stats.ts49
1 files changed, 25 insertions, 24 deletions
diff --git a/frontend/src/api/Stats.ts b/frontend/src/api/Stats.ts
index 21654b5..a334918 100644
--- a/frontend/src/api/Stats.ts
+++ b/frontend/src/api/Stats.ts
@@ -2,36 +2,37 @@ import axios from "axios";
2import { url } from "./Api"; 2import { url } from "./Api";
3 3
4export interface PortalCountData { 4export interface PortalCountData {
5 date: string; 5 date: string;
6 count: number; 6 count: number;
7} 7}
8 8
9export interface RecordsTimelineResponse { 9export interface RecordsTimelineResponse {
10 timeline_singleplayer: PortalCountData[]; 10 timeline_singleplayer: PortalCountData[];
11 timeline_multiplayer: PortalCountData[]; 11 timeline_multiplayer: PortalCountData[];
12} 12}
13 13
14export interface ScoreLog { 14export interface ScoreLog {
15 game: { 15 game: {
16 id: number; 16 id: number;
17 name: string; 17 name: string;
18 image: string; 18 image: string;
19 is_coop: boolean; 19 is_coop: boolean;
20 category_portals: null; 20 category_portals: null;
21 }; 21 };
22 user: { 22 user: {
23 steam_id: string; 23 steam_id: string;
24 user_name: string; 24 user_name: string;
25 }; 25 };
26 map: { 26 map: {
27 id: number; 27 id: number;
28 name: string; 28 name: string;
29 image: string; 29 image: string;
30 is_disabled: boolean; 30 is_disabled: boolean;
31 portal_count: number; 31 portal_count: number;
32 difficulty: number; 32 difficulty: number;
33 }; 33 };
34 score_count: number; 34 score_count: number;
35 date: string;
35} 36}
36 37
37export async function get_portal_count_history(): Promise<RecordsTimelineResponse | undefined> { 38export async function get_portal_count_history(): Promise<RecordsTimelineResponse | undefined> {