18 lines
445 B
JavaScript
18 lines
445 B
JavaScript
|
import * as Data from "../data.js";
|
||
|
|
||
|
|
||
|
const sportDropdown = document.getElementById('sport-dropdown');
|
||
|
|
||
|
async function listSports() {
|
||
|
sportDropdown.innerHTML = "";
|
||
|
|
||
|
const sportsList = await Data.getSports();
|
||
|
|
||
|
sportsList.forEach(sport => {
|
||
|
const option = document.createElement('option');
|
||
|
option.text = sport.name;
|
||
|
option.value = sport.id;
|
||
|
sportDropdown.appendChild(option);
|
||
|
});
|
||
|
}
|
||
|
listSports();
|