Added basic tierlist (fix #4)
All checks were successful
pipeline / build-and-push-images (push) Successful in 25s
pipeline / deploy (push) Successful in 6s

This commit is contained in:
2024-11-29 21:40:28 +01:00
parent e8743b5fab
commit 1bc273571f
2 changed files with 144 additions and 3 deletions

View File

@@ -6,8 +6,8 @@ const champions = championsData.value.slice(1).sort((a, b) => {
return 0;
})
const {data: championsLanes} : {data: Ref<any>} = await useFetch("/api/champions")
const lanesMap = new Map()
const {data: championsLanes} : {data: Ref<Array<ChampionData>>} = await useFetch("/api/champions")
const lanesMap : Map<string, Array<LaneData>> = new Map()
for(let champion of championsLanes.value) {
lanesMap.set(champion.alias, champion.lanes)
}
@@ -39,7 +39,7 @@ function filterToLane(filter: number) {
function onLaneFilterChange(newValue: number) {
if(newValue != -1) {
filteredChampions.value = champions.filter((champion) => {
const lanes : Array<any> = lanesMap.get(champion.alias.toLowerCase())
const lanes : Array<LaneData> | undefined = lanesMap.get(champion.alias.toLowerCase())
if(lanes == undefined) return false;
return lanes.reduce((acc : boolean, current : {data:string, count:number}) =>