예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }