private async Task <bool> UpdateLikes(FeedLike feedlike) { if (feedlike.FeedType == my8Enum.PostType.StatusPost) { if (string.IsNullOrWhiteSpace(feedlike.FeedId)) { return(false); } if (feedlike.Liked) { return(await _statusPostRepository.Like(feedlike.FeedId)); } else { return(await _statusPostRepository.UnLike(feedlike.FeedId)); } } else if (feedlike.FeedType == my8Enum.PostType.JobPost) { if (string.IsNullOrWhiteSpace(feedlike.FeedId)) { return(false); } if (feedlike.Liked) { return(await _jobPostRepository.Like(feedlike.FeedId)); } else { return(await _jobPostRepository.UnLike(feedlike.FeedId)); } } return(false); }
public async Task <bool> UpdateLikes(string postId, bool like) { if (string.IsNullOrWhiteSpace(postId)) { return(false); } if (like) { return(await _jobPostRepository.Like(postId)); } else { return(await _jobPostRepository.UnLike(postId)); } }