fix: use s.code as location select value, fall back to slugified name

The server webhook will soon return a 'code' field (e.g. 'fr',
'usa') alongside the display 'server' name. Use it as the option
value so the payment webhook receives the correct location code.
Falls back to the old slugified server name when code is absent
(e.g. current live API).
This commit is contained in:
Oliver
2026-06-15 12:22:47 -03:00
parent f84c62788e
commit 58cff06168
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -564,10 +564,11 @@
}
servers.forEach(function(s) {
const server = s.server || '';
const serverCode = s.code || server.toLowerCase().replace(/\s+/g, '-');
const available = parseInt(s['Seats Available'], 10) || 0;
const label = server.charAt(0).toUpperCase() + server.slice(1);
const opt = document.createElement('option');
opt.value = server.toLowerCase().replace(/\s+/g, '-');
opt.value = serverCode;
if (available <= 0) {
opt.textContent = label + ' (sold out)';
opt.disabled = true;