예제 #1
0
        public GetDashboardsResponse Handle(GetDashboardsRequest request)
        {
            var response = new GetDashboardsResponse();

            response.Errors = new List <ErrorStatus>();

            try
            {
                var dashboards = _dashboardsRepository.GetByUserId(request.Id);

                response.Dashboards = dashboards;

                if (response.Dashboards == null)
                {
                    response.Errors.Add(new ErrorStatus("You dont have any dashboards")); //sita mes jeigu ir unauthorized
                    return(response);
                }

                return(response);
            }
            catch (Exception ex)
            {
                //response.Errors.Add(new ErrorStatus("SYSTEM_ERROR"));

                response.Errors.Add(new ErrorStatus(ex.Message));

                // LOG TO FILE ex.Message

                return(response);
            }
        }