feat: implement multi-state tournament querying for Challonge API v2.1
- Add tournament-query.js utility with queryAllTournaments() and helper functions * Makes 3 parallel API calls (pending, in_progress, ended states) * Uses Promise.all() to wait for all requests * Deduplicates results by tournament ID using Map * Replaces invalid state: 'all' parameter (API doesn't support 'all' value) - Implement 5 convenience functions: * queryAllTournaments() - Query all states with custom options * queryUserTournaments() - Query user's tournaments (shorthand) * queryCommunityTournaments() - Query community tournaments * queryActiveTournaments() - Query pending + in_progress only * queryCompletedTournaments() - Query ended tournaments only * queryTournamentsByStates() - Query custom state combinations - Update ChallongeTest.vue to use queryAllTournaments() * Replace invalid state: 'all' with proper multi-state query * Now correctly fetches tournaments from all states * Update console logging to show all 3 states being queried - Add comprehensive TOURNAMENT_QUERY_GUIDE.md documentation * Explains the problem and solution * API reference for all functions * Implementation details and performance notes * Testing instructions * Future enhancement ideas
This commit is contained in:
1614
code/websites/pokedex.online/src/views/ChallongeTest.vue
Normal file
1614
code/websites/pokedex.online/src/views/ChallongeTest.vue
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user