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