From 2bb137b3141a19f2b2eb329fef8a0076c65230dd Mon Sep 17 00:00:00 2001 From: Xinos Date: Fri, 17 May 2024 22:29:48 +0700 Subject: [PATCH] win loss draw for wsmatches --- src/pages/WSMatches.vue | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/pages/WSMatches.vue b/src/pages/WSMatches.vue index 6bdeabb5f..49258dbd1 100644 --- a/src/pages/WSMatches.vue +++ b/src/pages/WSMatches.vue @@ -32,9 +32,11 @@ {{ match.Corporation2Name }}

+ {{ getCorpStat(match.Corporation1Id) }} {{ match.Corporation1Score }} - {{ match.Corporation2Score }} + {{ getCorpStat(match.Corporation2Id) }}

@@ -133,6 +135,16 @@ async function fetchData() { response.value = await fetch(matchesUrl) .then((r) => r.json()); } +function getCorpStat(id: string) { + const corp = corps.value.find((e) => e.Id == id); + + if (corp) { + const [w, l, d, e] = Object.entries(corp) + .filter(([k]) => !['Name', 'Id'].includes(k)) + .map(([, v]) => v); + return `[W:${w}/L:${l}/D:${d}/E:${e}]`; + } +}