示例#1
0
        public async Task <IActionResult> DeletePOIType(int poiTypeId, CancellationToken cancellationToken)
        {
            var type = await _mappingService.GetTypeByIdAsync(poiTypeId);

            if (type != null)
            {
                if (type.DepartmentId != DepartmentId)
                {
                    Unauthorized();
                }

                await _mappingService.DeletePOITypeAsync(poiTypeId, cancellationToken);
            }

            return(RedirectToAction("POIs"));
        }