コード例 #1
0
        public async Task <IActionResult> PagedHomePosts([FromQuery] PaginationParams input)
        {
            var token = GetToken();

            if (!String.IsNullOrEmpty(token))
            {
                var userId = LoginHelper.GetClaim(token, "UserId");
                input.EntityId = Guid.Parse(userId);
            }

            if (input.EntityId == null)
            {
                return(Unauthorized());
            }

            var post = await _postAppService.PagedHomePosts(input);

            return(Ok(post));
        }