
        
        return fetch('/api/v1/cables/types')
            .then(response => response.json())
            .then(data => {
                if (data.types) {
                    console.log(`Got ${data.types.length} cable types:`, data.types);
                    select.innerHTML = '<option value="">Select cable type</option>';
                    data.types.forEach(type => {
                        const option = document.createElement('option');
                        option.value = type.cable_type