2024-02-02 20:39:43 +00:00
|
|
|
function updateMonsterDropdownByFamily() {
|
2024-02-02 02:52:59 +00:00
|
|
|
const selectedFamily = familyDropdown.value;
|
|
|
|
|
|
|
|
// Fetch monsters data from the server based on the selected family
|
2024-02-05 19:37:24 +00:00
|
|
|
fetch(`/api/monsters?family=${selectedFamily}`)
|
2024-02-02 02:52:59 +00:00
|
|
|
.then(response => response.json())
|
|
|
|
.then(data => populateDropdown(monsterDropdown, data))
|
|
|
|
.catch(error => console.error("Error fetching monsters:", error));
|
|
|
|
}
|