Exemplo n.º 1
0
        public async Task <IActionResult> CloseFeedback(long id)
        {
            try
            {
                var data = await _feedbackService.CloseFeedbackAsync(id);

                return(Ok(data));
            }
            catch (UnauthorizedAccessException)
            {
                return(Unauthorized());
            }
            catch (DbUpdateConcurrencyException)
            {
                return(BadRequest(new
                {
                    Message =
                        "The record you attempted to edit was modified by another user after you got the original value"
                }));
            }
            catch (NoPermissionException)
            {
                return(Forbid());
            }
            catch (Exception e)
            {
                return(BadRequest(new { e.Message }));
            }
        }