Example #1
0
        public async Task <ActionResult <DepartmentCheckResult> > CheckIfDepartmentNameUsed(string departmentName)
        {
            var result = new DepartmentCheckResult();

            if (!String.IsNullOrWhiteSpace(departmentName))
            {
                var name = HttpUtility.UrlDecode(departmentName);
                result.DepartmentNameInUse = await _departmentsService.DoesDepartmentExistAsync(name);

                return(result);
            }

            return(BadRequest());
        }