Example #1
0
        public async Task <ListQueryResult <CreditRequestViewModel> > GetDepartmentCreditRequestsAsync(DepartmentCreditRequestsQuery query)
        {
            var rightsRes = await CheckEmployeeRightsAsync(query.EmployeeId, EmployeeRights.CreditDepartmentChief);

            if (rightsRes.IsFailed)
            {
                return(new ListQueryResult <CreditRequestViewModel>(query, null, false).From(rightsRes));
            }
            return(Filter(await _creditRequestService.GetDepartmentRequestsAsync(new DepartmentRequestsQuery()), query));
        }