feat(match): add endpoint to retrieve active players for a club

- Implemented a new controller method `getMatchPlayers` to fetch active members of a specified club, returning their details.
- Updated the match routes to include a new GET route for retrieving players by club ID.
- Modified the ScheduleView to include the current club ID when updating player information.
This commit is contained in:
Torsten Schulz (local)
2026-02-05 22:58:44 +01:00
parent 84bbcb0f87
commit 5605cd6189
3 changed files with 21 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
import express from 'express';
import { uploadCSV, getLeaguesForCurrentSeason, getMatchesForLeagues, getMatchesForLeague, getLeagueTable, fetchLeagueTableFromMyTischtennis, updateMatchPlayers, getPlayerMatchStats } from '../controllers/matchController.js';
import { uploadCSV, getLeaguesForCurrentSeason, getMatchesForLeagues, getMatchesForLeague, getLeagueTable, fetchLeagueTableFromMyTischtennis, updateMatchPlayers, getPlayerMatchStats, getMatchPlayers } from '../controllers/matchController.js';
import { authenticate } from '../middleware/authMiddleware.js';
import { authorize } from '../middleware/authorizationMiddleware.js';
import multer from 'multer';
@@ -14,6 +14,7 @@ router.get('/leagues/:clubId/matches/:leagueId', authenticate, authorize('schedu
router.get('/leagues/:clubId/matches', authenticate, authorize('schedule', 'read'), getMatchesForLeagues);
router.get('/leagues/:clubId/table/:leagueId', authenticate, authorize('schedule', 'read'), getLeagueTable);
router.post('/leagues/:clubId/table/:leagueId/fetch', authenticate, authorize('mytischtennis', 'write'), fetchLeagueTableFromMyTischtennis);
router.get('/:clubId/players', authenticate, authorize('schedule', 'read'), getMatchPlayers);
router.patch('/:matchId/players', authenticate, authorize('schedule', 'write'), updateMatchPlayers);
router.get('/leagues/:clubId/stats/:leagueId', authenticate, authorize('schedule', 'read'), getPlayerMatchStats);