From e55537ff8b5fa63d05bf4aaa977a01d4f2feb707 Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Wed, 28 Jan 2026 18:29:26 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=AE=20Add=20support=20for=20selecting?= =?UTF-8?q?=20tournament=20scope=20in=20Challonge=20API=20integration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/ChallongeTest.vue | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/code/websites/pokedex.online/src/views/ChallongeTest.vue b/code/websites/pokedex.online/src/views/ChallongeTest.vue index 5280850..45bf2df 100644 --- a/code/websites/pokedex.online/src/views/ChallongeTest.vue +++ b/code/websites/pokedex.online/src/views/ChallongeTest.vue @@ -50,16 +50,20 @@
-
- ✓ OAuth Connected - showing created and admin tournaments + + +
+ ✓ USER scope - tournaments you created or administer
- ⓘ API Key Mode - showing only created tournaments + ⓘ APPLICATION scope requires a client-credentials token with + application:manage
- - Shows tournaments you created and tournaments where you're an - admin -
@@ -364,7 +368,7 @@ const totalTournaments = ref(0); const hasNextPage = ref(false); // v2.1 Tournament Scope -const showAllTournaments = ref(false); // Show all tournaments vs user-only (requires OAuth) +const tournamentScope = ref(ScopeType.USER); // Debug mode (can be enabled via localStorage.setItem('DEBUG_CHALLONGE', 'true')) const debugMode = ref(false); @@ -468,13 +472,13 @@ async function testListTournaments(resetPagination = true) { const result = await queryAllTournaments(client.value, { page: currentPage.value, per_page: 100, - scopeType: ScopeType.USER + scopeType: tournamentScope.value }); console.log('📊 Tournament API Response (All States):', { page: currentPage.value, perPage: 100, - scope: 'USER', + scope: tournamentScope.value, states: [ 'pending', 'checking_in', @@ -513,7 +517,7 @@ async function loadMoreTournaments() { const result = await queryAllTournaments(client.value, { page: currentPage.value, per_page: 100, - scopeType: ScopeType.USER + scopeType: tournamentScope.value }); tournaments.value = [...tournaments.value, ...result];