feat: update navigation link for club payments in dashboard and enhance error handling in Home view
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 51s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 51s
This commit is contained in:
@@ -105,7 +105,12 @@
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
<section v-if="!dashboardLoading && clubDashboardSections.length === 0" class="card club-dashboard-empty">
|
||||
<section v-if="dashboardError" class="card club-dashboard-empty state-banner state-banner-error">
|
||||
<h3>Dashboard konnte nicht geladen werden</h3>
|
||||
<p>{{ dashboardError }}</p>
|
||||
<button type="button" class="btn-secondary" @click="loadClubDashboard">Erneut versuchen</button>
|
||||
</section>
|
||||
<section v-else-if="!dashboardLoading && clubDashboardSections.length === 0" class="card club-dashboard-empty">
|
||||
<h3>Noch keine Dashboard-Daten</h3>
|
||||
<p v-if="!currentClub">
|
||||
Wähle zuerst einen Verein aus, damit Aufgaben, Mitglieder, Trainings und Termine geladen werden.
|
||||
@@ -743,6 +748,7 @@ export default {
|
||||
return {
|
||||
dashboardSectionsOverride: null,
|
||||
dashboardLoading: false,
|
||||
dashboardError: '',
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -793,22 +799,28 @@ export default {
|
||||
await this.loadClubDashboard();
|
||||
},
|
||||
},
|
||||
appProduct() {
|
||||
this.loadClubDashboard();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['logout']),
|
||||
async loadClubDashboard() {
|
||||
if (!this.isTtVereinProduct || !this.isAuthenticated || !this.currentClub) {
|
||||
this.dashboardSectionsOverride = null;
|
||||
this.dashboardError = '';
|
||||
return;
|
||||
}
|
||||
|
||||
this.dashboardLoading = true;
|
||||
this.dashboardError = '';
|
||||
try {
|
||||
const response = await apiClient.get(`/club-dashboard/${this.currentClub}`);
|
||||
const sections = Array.isArray(response.data?.sections) ? response.data.sections : null;
|
||||
this.dashboardSectionsOverride = sections && sections.length > 0 ? sections : null;
|
||||
} catch (_error) {
|
||||
} catch (error) {
|
||||
this.dashboardSectionsOverride = null;
|
||||
this.dashboardError = error?.response?.data?.error || 'Bitte prüfe deine Verbindung und versuche es erneut.';
|
||||
} finally {
|
||||
this.dashboardLoading = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user