public async Task <IActionResult> GetAllDebts(DebtSearchObjectDTO model) { try { var data = await _debtService.GetAllDebtsAsync(model); return(Ok(data)); } catch (UnauthorizedAccessException) { return(Unauthorized()); } catch (Exception e) { return(BadRequest(new { e.Message })); } }