public IActionResult DeletePOIType(int poiTypeId) { var type = _mappingService.GetTypeById(poiTypeId); if (type != null) { if (type.DepartmentId != DepartmentId) { Unauthorized(); } _mappingService.DeletePOIType(poiTypeId); } return(RedirectToAction("POIs")); }