public async Task UnlikeComment(string commentId, string userId, string authenticationToken) { try { CommentLikeService commentLikeService = new CommentLikeService(); var response = await commentLikeService.UnlikeComment(commentId, userId, authenticationToken); if (!response.IsSuccessStatusCode) { if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized) { throw new Exception("Unauthorized"); } else { throw new Exception(response.StatusCode.ToString() + " - " + response.ReasonPhrase); } } } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task LikeComment(SurveyCommentLikeModel surveyCommentLikeModel, string authenticationToken) { try { CommentLikeService commentLikeService = new CommentLikeService(); var response = await commentLikeService.LikeComment(surveyCommentLikeModel, authenticationToken).ConfigureAwait(false); if (!response.IsSuccessStatusCode) { throw new Exception(response.StatusCode.ToString() + " - " + response.ReasonPhrase); } } catch (Exception ex) { throw new Exception(ex.Message); } }