From 00d82f151eb7d49dcab8f2a3ce99b2868267dc0e Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 15 Jun 2026 12:37:28 -0300 Subject: [PATCH] fix: map server names to location codes (fr, usa) in the option values --- add.html | 7 ++++++- assets/js/script.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/add.html b/add.html index a8b2249..df415db 100644 --- a/add.html +++ b/add.html @@ -562,12 +562,17 @@ if (minAvail <= 0) { sel.classList.add('no-seats'); } + const SERVER_CODES = { + france: "fr", + "united states": "usa", + }; + servers.forEach(function(s) { const server = s.server || ''; const available = parseInt(s['Seats Available'], 10) || 0; const label = server.charAt(0).toUpperCase() + server.slice(1); const opt = document.createElement('option'); - opt.value = s.code || ''; + opt.value = SERVER_CODES[server.toLowerCase()] || server.toLowerCase().replace(/\s+/g, '-'); if (available <= 0) { opt.textContent = label + ' (sold out)'; opt.disabled = true; diff --git a/assets/js/script.js b/assets/js/script.js index b1491e8..847aea8 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -667,12 +667,17 @@ async function initServerLocations() { sel.classList.add("no-seats"); } + const SERVER_CODES = { + france: "fr", + "united states": "usa", + }; + servers.forEach(function (s) { const server = s.server || ""; const available = parseInt(s["Seats Available"], 10) || 0; const label = server.charAt(0).toUpperCase() + server.slice(1); const opt = document.createElement("option"); - opt.value = s.code || ""; + opt.value = SERVER_CODES[server.toLowerCase()] || server.toLowerCase().replace(/\s+/g, "-"); if (available <= 0) { // No seats — red, disabled, cannot select