File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,18 @@ export function addRoutes(app: express$Application) {
3737 }
3838 } ) ;
3939
40- app . get ( '/stats' , async ( req : express$Request , res : express$Response ) => {
41- try {
42- res . json ( {
43- days : await getDailyStats ( )
44- } ) ;
45- } catch ( err ) {
46- res . sendStatus ( 500 ) ;
40+ app . get (
41+ '/daily-stats' ,
42+ async ( req : express$Request , res : express$Response ) => {
43+ try {
44+ res . json ( {
45+ days : await getDailyStats ( )
46+ } ) ;
47+ } catch ( err ) {
48+ res . sendStatus ( 500 ) ;
49+ }
4750 }
48- } ) ;
51+ ) ;
4952
5053 app . get ( '/game/:gameId' , ( req : express$Request , res : express$Response ) => {
5154 const gameId = req . params . gameId ;
Original file line number Diff line number Diff line change 33import React , { Component } from 'react' ;
44import withRedux from 'next-redux-wrapper' ;
55import { createStore } from '../store' ;
6- import { addCurUserToState , getStats } from '../utils/api' ;
6+ import { addCurUserToState , getDailyStats } from '../utils/api' ;
77import Layout from '../components/Layout' ;
88
99import type { DailyStats } from 'shared/types/state' ;
@@ -19,7 +19,7 @@ class StatsPage extends Component<Props> {
1919 await addCurUserToState ( req , store ) ;
2020 }
2121
22- const { days } = await getStats ( ) ;
22+ const { days } = await getDailyStats ( ) ;
2323 return { days } ;
2424 }
2525
Original file line number Diff line number Diff line change @@ -63,8 +63,8 @@ export async function backfillGameActions(
6363 return fetchPost ( `/backfill` , req ) ;
6464}
6565
66- export async function getStats ( ) : Promise < DailyStats > {
67- return fetchJson ( `/stats` ) ;
66+ export async function getDailyStats ( ) : Promise < DailyStats > {
67+ return fetchJson ( `/daily- stats` ) ;
6868}
6969
7070export function getApiUrl ( path ?: string ) {
You can’t perform that action at this time.
0 commit comments