dwm-app/static/js/updateMonstersDropdownByFamily.js

10 lines
401 B
JavaScript
Raw Normal View History

2024-02-02 17:24:53 +00:00
function updateMonstersDropdownByFamily() {
2024-02-02 02:52:59 +00:00
const selectedFamily = familyDropdown.value;
// Fetch monsters data from the server based on the selected family
fetch(`/get_monsters?family=${selectedFamily}`)
.then(response => response.json())
.then(data => populateDropdown(monsterDropdown, data))
.catch(error => console.error("Error fetching monsters:", error));
}