Beispiel #1
0
        private async void OnFollowClicked(object sender, System.EventArgs e)
        {
            var followSpotViewModel = new FollowSpotViewModel()
            {
                SpotId = viewModel.Location.Id
            };
            var result = await viewModel.FollowSpot(followSpotViewModel);

            if (result)
            {
                viewModel.LoadItemsCommand.Execute(null);
            }
        }
Beispiel #2
0
        public async Task <IActionResult> FollowSpot([FromBody] FollowSpotViewModel model)
        {
            var accessToken = HttpContext.Request.Headers["Authorization"].ToString().GetAccessTokenFromHeaderString();
            var userId      = await _identityService.GetUserId(accessToken);

            var result = await _playerService.AddPlayerSpot(userId, model.SpotId);

            if (result)
            {
                return(Ok(new { IsSuccess = true }));
            }

            return(BadRequest(new { IsSuccess = false }));
        }