Skip to content

Commit

Permalink
Merge pull request #516 from ipax77/dev
Browse files Browse the repository at this point in the history
fix review year request
  • Loading branch information
ipax77 authored Sep 28, 2024
2 parents e38a922 + af2e5e3 commit c96633a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/dsstats.api/Controllers/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,16 @@ public async Task<ActionResult<ReviewResponse>> GetReviewRatingTypeInfo(ReviewRe
}

[HttpGet]
[Route("reviewyear/{ratingType:int}")]
public async Task<ActionResult<ReviewYearResponse>> GetYearReview(int ratingType, CancellationToken token)
[Route("reviewyear/{ratingType:int}/{year:int}")]
public async Task<ActionResult<ReviewYearResponse>> GetYearReview(int ratingType, int year, CancellationToken token)
{
return await reviewService.GetYearReview((RatingType)ratingType, 2023, token);
return await reviewService.GetYearReview((RatingType)ratingType, year, token);
}

[HttpGet]
[Route("reviewyearratingtypeinfo/{ratingType:int}")]
public async Task<ActionResult<ReviewYearResponse>> GetYearReviewratingtypeinfo(int ratingType, CancellationToken token)
[Route("reviewyearratingtypeinfo/{ratingType:int}/{year:int}")]
public async Task<ActionResult<ReviewYearResponse>> GetYearReviewratingtypeinfo(int ratingType, int year, CancellationToken token)
{
return await reviewService.GetYearRatingTypeReview((RatingType)ratingType, 2023, token);
return await reviewService.GetYearRatingTypeReview((RatingType)ratingType, year, token);
}
}
4 changes: 2 additions & 2 deletions src/dsstats.apiServices/ReviewService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task<ReviewYearResponse> GetYearRatingTypeReview(RatingType ratingT
{
try
{
var response = await httpClient.GetFromJsonAsync<ReviewYearResponse>($"{playerController}/reviewyearratingtypeinfo/{(int)ratingType}");
var response = await httpClient.GetFromJsonAsync<ReviewYearResponse>($"{playerController}/reviewyearratingtypeinfo/{(int)ratingType}/{year}");
return response ?? new();
}
catch (Exception ex)
Expand All @@ -59,7 +59,7 @@ public async Task<ReviewYearResponse> GetYearReview(RatingType ratingType, int y
{
try
{
var response = await httpClient.GetFromJsonAsync<ReviewYearResponse>($"{playerController}/reviewyear/{(int)ratingType}");
var response = await httpClient.GetFromJsonAsync<ReviewYearResponse>($"{playerController}/reviewyear/{(int)ratingType}/{year}");
return response ?? new();
}
catch (Exception ex)
Expand Down

0 comments on commit c96633a

Please sign in to comment.