Пример #1
0
        public async Task <IActionResult> AddUserFeedBack([FromBody] FeedBackDto feedbackDto)
        {
            string CustomerData;

            try
            {
                string userId = null;
                userId = User.FindFirst("userId").Value;
                if (userId == null)
                {
                    return(this.Ok(new ResponseEntity(HttpStatusCode.OK, "Invalid Token", userId, "")));
                }
                CustomerData = await Task.FromResult(CustomerService.AddUserFeedBack(feedbackDto, userId));

                if (!CustomerData.Contains("Not") && CustomerData != null)
                {
                    return(this.Ok(new ResponseEntity(HttpStatusCode.OK, CustomerData, feedbackDto, "")));
                }
            }
            catch
            {
                return(this.BadRequest(new ResponseEntity(HttpStatusCode.BadRequest, "Bad Request", null, "")));
            }
            return(this.Ok(new ResponseEntity(HttpStatusCode.NoContent, CustomerData, null, "")));
        }