Fix moving during locations filtering [SCI-11137]

This commit is contained in:
Anton 2024-10-03 12:24:50 +02:00
parent 3a792ea737
commit f6b7998458

View file

@ -34,13 +34,13 @@ export default {
},
methods: {
filteredStorageLocationsTreeHelper(storageLocationsTree) {
return storageLocationsTree.map(({ storage_location, children }) => {
return storageLocationsTree.map(({ storage_location, children, can_manage }) => {
if (storage_location.name.toLowerCase().includes(this.query.toLowerCase())) {
return { storage_location, children };
return { storage_location, children, can_manage };
}
const filteredChildren = this.filteredStorageLocationsTreeHelper(children);
return filteredChildren.length ? { storage_location, children: filteredChildren } : null;
return filteredChildren.length ? { storage_location, can_manage, children: filteredChildren } : null;
}).filter(Boolean);
},
selectStorageLocation(storageLocationId) {