From f5921180cf8679189eca72983c94ac4811edbcf2 Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Mon, 20 Feb 2023 14:43:35 +0100 Subject: [PATCH] Clean GetAllBeaconsForInstance accept return empty list --- ManagerService/Controllers/SectionController.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ManagerService/Controllers/SectionController.cs b/ManagerService/Controllers/SectionController.cs index 9d11020..c013738 100644 --- a/ManagerService/Controllers/SectionController.cs +++ b/ManagerService/Controllers/SectionController.cs @@ -238,16 +238,13 @@ namespace ManagerService.Controllers [ProducesResponseType(typeof(List), 200)] [ProducesResponseType(typeof(string), 404)] [ProducesResponseType(typeof(string), 500)] - [HttpGet("beacons/{id}")] + [HttpGet("beacons/{instanceId}")] public ObjectResult GetAllBeaconsForInstance(string instanceId) { try { List
sections = _sectionService.GetAll(instanceId); - if (sections.Count == 0) - throw new KeyNotFoundException("No section has beacon"); - sections = sections.Where(s => s.IsBeacon && s.BeaconId != null).ToList(); return new OkObjectResult(sections.Select(s => s.ToDTO()));