🎮 Add support for selecting tournament scope in Challonge API integration
This commit is contained in:
@@ -50,16 +50,20 @@
|
||||
|
||||
<!-- Tournament Scope (v2.1 only) -->
|
||||
<div v-if="apiVersion === 'v2.1'" class="control-group">
|
||||
<div class="info-badge" v-if="isAuthenticated">
|
||||
✓ OAuth Connected - showing created and admin tournaments
|
||||
<label class="control-label">Tournament scope:</label>
|
||||
<select v-model="tournamentScope" class="select-input">
|
||||
<option :value="ScopeType.USER">User (default)</option>
|
||||
<option :value="ScopeType.APPLICATION">
|
||||
Application (requires application:manage token)
|
||||
</option>
|
||||
</select>
|
||||
<div class="info-badge" v-if="tournamentScope === ScopeType.USER">
|
||||
✓ USER scope - tournaments you created or administer
|
||||
</div>
|
||||
<div class="info-badge warning" v-else>
|
||||
ⓘ API Key Mode - showing only created tournaments
|
||||
ⓘ APPLICATION scope requires a client-credentials token with
|
||||
application:manage
|
||||
</div>
|
||||
<span class="scope-hint">
|
||||
Shows tournaments you created and tournaments where you're an
|
||||
admin
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- OAuth Authentication (v2.1 only) -->
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user