feat(official-tournaments): implement reimport functionality for official tournaments
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 57s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 57s
This commit is contained in:
@@ -232,6 +232,9 @@
|
||||
@click="generateMembersPdf">
|
||||
{{ $t('officialTournaments.pdfForSelectedMembers') }}
|
||||
</button>
|
||||
<button class="btn-secondary" :disabled="reimporting" @click="reimportTournament">
|
||||
{{ reimporting ? 'Aktualisiert …' : 'Daten aktualisieren' }}
|
||||
</button>
|
||||
<button
|
||||
v-if="primaryHeaderAction !== 'auto-register'"
|
||||
class="btn-secondary"
|
||||
@@ -565,6 +568,7 @@
|
||||
<div class="calendar-entry-empty">
|
||||
<h3>Kalendereintrag geöffnet</h3>
|
||||
<p>Für dieses Turnier sind noch keine Konkurrenzen hinterlegt. Importiere eine Ausschreibung als PDF, sobald du Teilnehmer oder Ergebnisse verwalten möchtest.</p>
|
||||
<button class="btn-secondary" :disabled="reimporting" @click="reimportTournament">{{ reimporting ? 'Aktualisiert …' : 'Daten aktualisieren' }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="workspace-detail empty-workspace">
|
||||
@@ -690,6 +694,7 @@ export default {
|
||||
editingTournamentId: null,
|
||||
editingTitle: '',
|
||||
autoRegistering: false,
|
||||
reimporting: false,
|
||||
suggestions: [], fetchingSuggestions: false, suggestionError: '',
|
||||
suggestionSearch: '', suggestionStatusFilter: 'new',
|
||||
tacticPlans: [], tacticPlan: null, tacticPlansSnapshot: '', tacticsLoading: false, tacticSaving: false, tacticsError: '', tacticTournamentId: null, tacticLoadToken: 0, reloadToken: 0,
|
||||
@@ -1678,6 +1683,16 @@ export default {
|
||||
this.workspaceTab = 'saved';
|
||||
} catch (error) { this.suggestionError = getSafeErrorMessage(error, 'Der Vorschlag konnte nicht gespeichert werden.'); }
|
||||
},
|
||||
async reimportTournament() {
|
||||
if (!this.uploadedId || this.reimporting) return;
|
||||
this.reimporting = true;
|
||||
try {
|
||||
const response = await apiClient.post(`/official-tournaments/${this.currentClub}/${this.uploadedId}/reimport`);
|
||||
await Promise.all([this.reload(), this.loadList()]);
|
||||
await this.showInfo('Turnierdaten aktualisiert', `${response.data?.updatedCount || 0} Datenbereiche wurden aus myTischtennis aktualisiert.`, '', 'success');
|
||||
} catch (error) { await this.showInfo('Aktualisierung nicht möglich', getSafeErrorMessage(error, 'Die Turnierdaten konnten nicht aktualisiert werden.'), '', 'error'); }
|
||||
finally { this.reimporting = false; }
|
||||
},
|
||||
buildParticipationMap(entries) {
|
||||
const map = {};
|
||||
for (const e of entries) {
|
||||
|
||||
Reference in New Issue
Block a user