public async Task <IActionResult> UpdateZoneName(UpdateZoneNameViewModel model) { var currentIdentityUser = await _userManager.GetUserAsync(User); var currentPersonId = currentIdentityUser.PersonId; _zoneService.UpdateZoneName(model.ZoneId, model.ZoneName, currentPersonId); return(Ok()); }
public async Task <IActionResult> CheckIfNameAvailable(UpdateZoneNameViewModel model) { var currentIdentityUser = await _userManager.GetUserAsync(User); var currentPersonId = currentIdentityUser.PersonId; var isAvailable = _zoneService.ValidateName(model.ZoneId, model.ZoneName, currentPersonId); return(Json(new { isAvailable })); }