Quick scan over GH diff fixes
This commit is contained in:
parent
184cf46533
commit
41faa30e6f
3 changed files with 2 additions and 7 deletions
|
|
@ -36,7 +36,7 @@ public class RatingController : BaseApiController
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<ActionResult> UpdateRating(UpdateRatingDto updateRating)
|
public async Task<ActionResult> UpdateRating(UpdateRatingDto updateRating)
|
||||||
{
|
{
|
||||||
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId(), AppUserIncludes.Ratings);
|
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId(), AppUserIncludes.Ratings | AppUserIncludes.ChapterRatings);
|
||||||
if (user == null) throw new UnauthorizedAccessException();
|
if (user == null) throw new UnauthorizedAccessException();
|
||||||
|
|
||||||
if (await _ratingService.UpdateRating(user, updateRating))
|
if (await _ratingService.UpdateRating(user, updateRating))
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public class UserReviewDto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
public int TotalVotes { get; set; }
|
public int TotalVotes { get; set; }
|
||||||
public bool HasBeenRated { get; set; }
|
public float Rating { get; set; }
|
||||||
public string? RawBody { get; set; }
|
public string? RawBody { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How many upvotes this review has gotten
|
/// How many upvotes this review has gotten
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import {environment} from "../../environments/environment";
|
||||||
import { HttpClient } from "@angular/common/http";
|
import { HttpClient } from "@angular/common/http";
|
||||||
import {Volume} from "../_models/volume";
|
import {Volume} from "../_models/volume";
|
||||||
import {TextResonse} from "../_types/text-response";
|
import {TextResonse} from "../_types/text-response";
|
||||||
import {UserReview} from "../_single-module/review-card/user-review";
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
|
@ -30,8 +29,4 @@ export class VolumeService {
|
||||||
return this.httpClient.post(this.baseUrl + 'volume/update', volume, TextResonse);
|
return this.httpClient.post(this.baseUrl + 'volume/update', volume, TextResonse);
|
||||||
}
|
}
|
||||||
|
|
||||||
volumeReviews(volumeId: number) {
|
|
||||||
return this.httpClient.get<UserReview[]>(this.baseUrl + 'volume/review?volumeId='+volumeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue