예제 #1
0
        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());
        }
예제 #2
0
        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 }));
        }