From b41f887712ef8f2f0b602da3042261a78c5f492a Mon Sep 17 00:00:00 2001 From: transtrike Date: Mon, 1 Feb 2021 16:03:38 +0200 Subject: Commented out implementation of Rating; Bug fixes --- src/DevHive.Data/Repositories/RatingRepository.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/DevHive.Data/Repositories/RatingRepository.cs') diff --git a/src/DevHive.Data/Repositories/RatingRepository.cs b/src/DevHive.Data/Repositories/RatingRepository.cs index 43fe90d..d676f27 100644 --- a/src/DevHive.Data/Repositories/RatingRepository.cs +++ b/src/DevHive.Data/Repositories/RatingRepository.cs @@ -9,29 +9,26 @@ namespace DevHive.Data.Repositories public class RatingRepository : BaseRepository, IRatingRepository { private readonly DevHiveContext _context; + private readonly IPostRepository _postRepository; - public RatingRepository(DevHiveContext context) + public RatingRepository(DevHiveContext context, IPostRepository postRepository) : base(context) { this._context = context; + this._postRepository = postRepository; } public async Task GetByPostId(Guid postId) { - return await this._context.Rating - .FirstOrDefaultAsync(x => x.Post.Id == postId); - } - - public async Task> GetRating(Guid postId) - { - Rating rating = await this.GetByPostId(postId); - - return new Tuple(rating.Likes, rating.Dislikes); + throw new NotImplementedException(); + // return await this._context.Rating + // .FirstOrDefaultAsync(x => x.Post.Id == postId); } - public async Task HasUserRatedThisPost(Guid userId, Guid postId) + public async Task GetRating(Guid postId) { throw new NotImplementedException(); + // return (await this.GetByPostId(postId)).Rate; } } } -- cgit v1.2.3