예제 #1
0
        public async Task <IActionResult> Create([FromBody] GuidFieldViewModel model)
        {
            await _service.CreateWatchmanAsync(new WatchmanProfileHealth()
            {
                Id = model.Id
            });

            return(Ok());
        }
예제 #2
0
        public async Task <IActionResult> CreateWatchmanProfile()
        {
            var token = this.GetAccessTokenFromCookies();
            var email = this.GetUserEmailFromHttpContext();

            var          user        = _userManager.FindByEmailAsync(email, token).Result;
            WatchmanInfo newWatchman = new WatchmanInfo()
            {
                Id = Guid.NewGuid()
            };

            await _watchmanPatientService.CreateWatchmanAsync(newWatchman, token);

            await _userHealthService.AddWatchmanToUserAsync(user.Id, newWatchman.Id, token);

            return(RedirectToAction("WatchmanProfile"));
        }