public async Task <ActionResult <List <ComplaintDto> > > GetComplaints()
        {
            try
            {
                var complaints = await _complaintService.GetComplaints();

                return(Ok(complaints));
            }
            catch (UnauthorizedAccessException ex)
            {
                return(Forbid(ex.Message));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Ejemplo n.º 2
0
 public ActionResult <IEnumerable <Complaints> > Get()
 {
     return(Ok(_complaintService?.GetComplaints()));
 }