コード例 #1
0
        public async Task <IActionResult> Vote(CreateVoteDto input)
        {
            var token  = GetToken();
            var userId = LoginHelper.GetClaim(token, "UserId");

            if (input.UserId != Guid.Parse(userId))
            {
                return(Unauthorized());
            }

            var result = await _postAppService.Vote(input);

            var success = result.Id != Guid.Empty;

            return(Ok(new { success }));
        }