Ejemplo 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" }));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeletePatientProfile([FromBody] GuidFieldViewModel model)
        {
            await _service.DeletePatientProfile(model.Id);

            return(NoContent());
        }