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