Skip to content

Commit

Permalink
Merge pull request #25 from grumd/feature/profile-info
Browse files Browse the repository at this point in the history
Added new grade graphs
  • Loading branch information
grumd authored Jan 11, 2024
2 parents 4b86b56 + d71651d commit 3b7e1ec
Show file tree
Hide file tree
Showing 21 changed files with 857 additions and 321 deletions.
262 changes: 162 additions & 100 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE chart_instances ADD COLUMN type ENUM('S', 'D');
UPDATE chart_instances SET type = 'S' WHERE label like 'S%';
UPDATE chart_instances SET type = 'D' WHERE label like 'D%';
16 changes: 14 additions & 2 deletions packages/api/src/controllers/players/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash/fp';
import type { Response, Request, NextFunction } from 'express';

import _ from 'lodash/fp';
import { getPlayerGradeStats } from 'services/players/playerGrades';
import { getPlayers, getPlayersStats } from 'services/players/players';

export const getPlayersAllController = async (
Expand All @@ -26,3 +26,15 @@ export const getPlayersStatsController = async (
next(error);
}
};

export const getPlayerGradesController = async (
request: Request,
response: Response,
next: NextFunction
) => {
try {
response.json(await getPlayerGradeStats(_.toNumber(request.params.playerId)));
} catch (error) {
next(error);
}
};
Loading

0 comments on commit 3b7e1ec

Please sign in to comment.