Skip to content

Commit

Permalink
feat: info for members classification
Browse files Browse the repository at this point in the history
  • Loading branch information
tiptenbrink committed Jan 4, 2024
1 parent 6f13757 commit 20e84e4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backend/src/apiserver/app/routers/ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def get_classification(
return RawJSONResponse(UserPointsNamesList.dump_json(user_points))


async def get_classification_with_meta(
async def get_classification_with_info(
dsrc: Source, ctx: RankingContext, rank_type: str, admin: bool = False
) -> RawJSONResponse:
if not is_rank_type(rank_type):
Expand All @@ -107,6 +107,15 @@ async def get_classification_with_meta(
return RawJSONResponse(RankingInfo.model_dump_json(ranking_info).encode())


@ranking_members_router.get("/get_with_info/{rank_type}/", response_model=RankingInfo)
async def member_classification_with_info(
rank_type: str, dsrc: SourceDep, app_context: AppContext
) -> RawJSONResponse:
return await get_classification_with_info(
dsrc, app_context.rank_ctx, rank_type, False
)


@ranking_admin_router.get("/get_meta/{recent_number}/", response_model=list[ClassView])
async def get_classifications(
recent_number: int, dsrc: SourceDep, app_context: AppContext
Expand Down

0 comments on commit 20e84e4

Please sign in to comment.