コード例 #1
0
        public async Task <IActionResult> GetInitiatives([FromQuery] string filter)
        {
            IEnumerable <InitiativeViewModel> initiatives = null;

            if (filter == "my")
            {
                int userId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value);
                initiatives = await _initiativeService.GetInitiativesAsync(userId);
            }
            else
            {
                initiatives = await _initiativeService.GetInitiativesAsync(null);
            }
            return(Ok(initiatives));
        }