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)); } }
public ActionResult <IEnumerable <Complaints> > Get() { return(Ok(_complaintService?.GetComplaints())); }