Export fix

This commit is contained in:
Thomas Fransolet 2024-03-21 16:02:31 +01:00
parent fe48dddce2
commit b5a3336670
2 changed files with 6 additions and 1 deletions

View File

@ -394,7 +394,7 @@ namespace ManagerService.Controllers
if (configuration == null) if (configuration == null)
throw new KeyNotFoundException("Configuration does not exist"); throw new KeyNotFoundException("Configuration does not exist");
List<SectionDTO> sectionDTOs = _sectionService.GetAllFromConfiguration(configuration.Id).Select(s => s.ToDTO()).ToList(); List<SectionDTO> sectionDTOs = _sectionService.GetAllFromConfigurationEvenSubsection(configuration.Id).Select(s => s.ToDTO()).ToList();
List<ResourceDTO> resourceDTOs = new List<ResourceDTO>(); List<ResourceDTO> resourceDTOs = new List<ResourceDTO>();
if (configuration.ImageId != null) if (configuration.ImageId != null)

View File

@ -29,6 +29,11 @@ namespace Manager.Services
return _Sections.Find(s => !s.IsSubSection && s.ConfigurationId == configurationId).ToList(); return _Sections.Find(s => !s.IsSubSection && s.ConfigurationId == configurationId).ToList();
} }
public List<Section> GetAllFromConfigurationEvenSubsection(string configurationId)
{
return _Sections.Find(s => s.ConfigurationId == configurationId).ToList();
}
public List<string> GetAllIdsFromConfiguration(string configurationId) public List<string> GetAllIdsFromConfiguration(string configurationId)
{ {
return _Sections.Find(s => !s.IsSubSection && s.ConfigurationId == configurationId).ToList().Select(s => s.Id).ToList(); return _Sections.Find(s => !s.IsSubSection && s.ConfigurationId == configurationId).ToList().Select(s => s.Id).ToList();