From d6565acc7f61f4d7ce5df34b56b60d565ee643db Mon Sep 17 00:00:00 2001 From: Chris kerr Date: Sat, 24 Feb 2024 14:30:47 -0500 Subject: [PATCH] breed usage no longer has any duplicates --- static/js/updateBreedingUsage.js | 47 ++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/static/js/updateBreedingUsage.js b/static/js/updateBreedingUsage.js index e7bddf9..31a5972 100644 --- a/static/js/updateBreedingUsage.js +++ b/static/js/updateBreedingUsage.js @@ -1,32 +1,39 @@ function updateBreedingUsage() { - // Get the selected monster from the dropdown - var selectedMonster = document.getElementById("monsterDropdown").value; + // Get the selected monster from the dropdown + var selectedMonster = document.getElementById("monsterDropdown").value; - // Fetch data from the API - fetch(`/api/breeding/usage/${selectedMonster}`) + // Fetch data from the API + fetch(`/api/breeding/usage/${selectedMonster}`) .then(response => response.json()) .then(data => { - // Update the HTML with the list of offspring monsters - renderOffspringList(data.used_in); + // Update the HTML with the list of offspring monsters + renderOffspringList(data.used_in); }) .catch(error => console.error('Error fetching data:', error)); - } +} - function renderOffspringList(usageData) { - var offspringContainer = document.getElementById("offspringContainer"); +function renderOffspringList(usageData) { + var offspringContainer = document.getElementById("offspringContainer"); - // Clear previous HTML content - offspringContainer.innerHTML = "

Used to Breed:

"; +}