コード例 #1
0
        public async Task <IActionResult> DeleteWatchmanProfile()
        {
            var userStringId     = User.FindFirstValue("userIdClaim");
            var watchmanStringId = User.FindFirstValue("watchmanIdClaim");

            if (String.IsNullOrWhiteSpace(userStringId) ||
                !Guid.TryParse(userStringId, out var userId) ||
                !Guid.TryParse(watchmanStringId, out var watchmanId))
            {
                return(RedirectToAction("RefreshToken", "Account", new { returnUrl = Request.Path.Value }));
            }
            else
            {
                await _userHealthService.RemoveWatchmanFromUser(userId, this.GetAccessTokenFromCookies());

                await _watchmanPatientService.DeleteWatchmanProfile(watchmanId, this.GetAccessTokenFromCookies());

                return(RedirectToAction("RefreshToken", "Account", new { returnUrl = @"\Account\Account" }));
            }
        }
コード例 #2
0
        public async Task <IActionResult> DeleteWatchmanProfile([FromBody] GuidFieldViewModel model)
        {
            await _service.DeleteWatchmanProfile(model.Id);

            return(NoContent());
        }