fix(ui): ensure numerical ID resolution in GET filters for OU selections
parent
a57fa1fcfa
commit
414076b45f
|
|
@ -1,5 +1,10 @@
|
|||
# Changelog
|
||||
|
||||
## [1.14.4] - 2026-10-09
|
||||
|
||||
### Fixed
|
||||
- **UI/UX (Componentes Genéricos)**: Solucionado un error en los componentes de añadir equipos a una subred (`add-clients-to-subnet`) y configuración de ficheros de arranque PXE (`pxe-boot-files`) introducido en versiones previas. Estos componentes enviaban un identificador URI (ej. `/organizational-units/uuid`) o el propio UUID en sus peticiones de búsqueda (GET) en lugar del ID numérico esperado por la base de datos (Doctrine), lo que impedía listar los equipos de las aulas seleccionadas. Ahora resuelven correctamente el ID numérico de la unidad seleccionada antes de realizar la petición al backend.
|
||||
|
||||
## [1.14.3] - 2026-10-09
|
||||
|
||||
### Fixed
|
||||
|
|
|
|||
|
|
@ -134,9 +134,15 @@ export class PxeBootFilesComponent implements OnInit {
|
|||
|
||||
loadChildUnits(event: any) {
|
||||
let unitId = event.value;
|
||||
if (typeof event.value === 'object' && event.value !== null) {
|
||||
|
||||
// Buscar la unidad organizativa seleccionada para obtener su ID numérico
|
||||
const selectedUnit = this.units.find(u => (u['@id'] || u.id) === event.value);
|
||||
if (selectedUnit && selectedUnit.id) {
|
||||
unitId = selectedUnit.id;
|
||||
} else if (typeof event.value === 'object' && event.value !== null) {
|
||||
unitId = event.value.id;
|
||||
} else if (typeof event.value === 'string' && event.value.includes('/')) {
|
||||
// Fallback por si acaso no se encuentra
|
||||
unitId = event.value.split('/').pop();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,9 +66,15 @@ export class AddClientsToSubnetComponent implements OnInit {
|
|||
|
||||
loadChildUnits(event: any) {
|
||||
let unitId = event.value;
|
||||
if (typeof event.value === 'object' && event.value !== null) {
|
||||
|
||||
// Buscar la unidad organizativa seleccionada para obtener su ID numérico
|
||||
const selectedUnit = this.units.find(u => (u['@id'] || u.id) === event.value);
|
||||
if (selectedUnit && selectedUnit.id) {
|
||||
unitId = selectedUnit.id;
|
||||
} else if (typeof event.value === 'object' && event.value !== null) {
|
||||
unitId = event.value.id;
|
||||
} else if (typeof event.value === 'string' && event.value.includes('/')) {
|
||||
// Fallback por si acaso no se encuentra (aunque debería)
|
||||
unitId = event.value.split('/').pop();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue