Enhance club rankings retrieval and member TTR updates
Updated the getClubRankings method in myTischtennisClient to include an optional parameter for current rankings. Modified memberService to fetch both current and quarterly TTR values, improving member data accuracy. Enhanced the TeamManagementView to display (Q)TTR values for better user visibility. Added error handling for QTTR retrieval, ensuring robustness in member updates.
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Spieler</th>
|
||||
<th title="(Q)TTR-Wert">(Q)TTR</th>
|
||||
<th title="Gesamte Saison (ab 1. Juli)">Saison</th>
|
||||
<th :title="isSecondHalf ? 'Rückrunde (ab 1. Januar)' : 'Vorrunde (Juli - Dezember)'">
|
||||
{{ isSecondHalf ? 'Rückrunde' : 'Vorrunde' }}
|
||||
@@ -76,6 +77,12 @@
|
||||
<tbody>
|
||||
<tr v-for="stat in playerStats" :key="stat.memberId">
|
||||
<td class="player-name">{{ stat.firstName }} {{ stat.lastName }}</td>
|
||||
<td class="stat-value">
|
||||
<span v-if="memberById[stat.memberId]">
|
||||
{{ memberById[stat.memberId].qttr ?? memberById[stat.memberId].ttr ?? '–' }}
|
||||
</span>
|
||||
<span v-else>–</span>
|
||||
</td>
|
||||
<td class="stat-value">{{ stat.totalSeason }}</td>
|
||||
<td class="stat-value">{{ isSecondHalf ? stat.totalSecondHalf : stat.totalFirstHalf }}</td>
|
||||
</tr>
|
||||
@@ -392,6 +399,7 @@ export default {
|
||||
// Player Stats
|
||||
const playerStats = ref([]);
|
||||
const loadingStats = ref(false);
|
||||
const memberById = ref({});
|
||||
|
||||
// Computed
|
||||
const selectedClub = computed(() => store.state.currentClub);
|
||||
@@ -1012,6 +1020,18 @@ export default {
|
||||
loadingStats.value = true;
|
||||
|
||||
try {
|
||||
// Mitglieder mit (Q)TTR laden, um Werte anzuzeigen
|
||||
try {
|
||||
const membersResp = await apiClient.get(`/clubmembers/get/${selectedClub.value}/true`);
|
||||
const map = {};
|
||||
for (const m of membersResp.data || []) {
|
||||
map[m.id] = { ttr: m.ttr ?? null, qttr: m.qttr ?? null };
|
||||
}
|
||||
memberById.value = map;
|
||||
} catch (e) {
|
||||
memberById.value = {};
|
||||
}
|
||||
|
||||
const response = await apiClient.get(
|
||||
`/matches/leagues/${selectedClub.value}/stats/${teamToEdit.value.leagueId}`,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user