Fix Unit Tests
This commit is contained in:
parent
f29c63c6c4
commit
749fb24185
7 changed files with 219 additions and 178 deletions
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using API.Constants;
|
||||
using API.Data;
|
||||
using API.Data.Repositories;
|
||||
using API.DTOs;
|
||||
using API.Extensions;
|
||||
using API.Services;
|
||||
|
|
@ -35,7 +36,10 @@ public class RatingController : BaseApiController
|
|||
[HttpPost]
|
||||
public async Task<ActionResult> UpdateRating(UpdateRatingDto updateRating)
|
||||
{
|
||||
if (await _ratingService.UpdateRating(User.GetUserId(), updateRating))
|
||||
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId(), AppUserIncludes.Ratings);
|
||||
if (user == null) throw new UnauthorizedAccessException();
|
||||
|
||||
if (await _ratingService.UpdateRating(user, updateRating))
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue