예제 #1
0
        public async Task <IActionResult> Get([FromRoute] string rosterId)
        {
            var rosterAccess = _rosterAccessService.GetRosterAccessAsync(GetBy.RosterId, HttpContext.GetUserId(), rosterId);

            if (rosterAccess is null)
            {
                return(CreateErrorResponse(Status.Forbidden));
            }

            var roster = await _rosterService.GetRosterByIdAsync(rosterId);

            if (roster == null)
            {
                return(NotFound());
            }
            //_logger.LogInfo("Getting all rosters.");
            return(Ok(new Response <RosterResponse>(_mapper.Map <RosterResponse>(roster))));
        }