Exemplo n.º 1
0
        public async Task <IActionResult> DeletePatientProfile()
        {
            var userStringId    = User.FindFirstValue("userIdClaim");
            var patientStringId = User.FindFirstValue("patientIdClaim");

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

                await _watchmanPatientService.DeletePatientProfile(patientId, this.GetAccessTokenFromCookies());

                return(RedirectToAction("RefreshToken", "Account", new { returnUrl = @"\Account\Account" }));
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> DeletePatient([FromBody] GuidFieldViewModel model)
        {
            await _userHealthService.RemovePatientFromUser(model.Id);

            return(Ok());
        }