fix: improve error handling for CSV import in upload and ScheduleView
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 51s

This commit is contained in:
Torsten Schulz (local)
2026-07-17 13:48:56 +02:00
parent 370df07c2a
commit 35031e3ae5
2 changed files with 13 additions and 3 deletions

View File

@@ -2206,16 +2206,24 @@ export default {
formData.append('clubId', this.currentClub);
try {
await apiClient.post('/matches/import', formData, {
const response = await apiClient.post('/matches/import', formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
});
if (response.status < 200 || response.status >= 300) {
throw new Error(response.data?.error || 'Failed to import CSV data');
}
this.showInfo(this.$t('messages.success'), this.$t('schedule.scheduleImportSuccess'), '', 'success');
this.closeImportModal();
this.loadTeams();
} catch (error) {
this.showInfo(this.$t('messages.error'), this.$t('schedule.errorImportingCSV'), '', 'error');
this.showInfo(
this.$t('messages.error'),
getSafeErrorMessage(error, this.$t('schedule.errorImportingCSV')),
'',
'error'
);
}
},
// Sortierfunktion für Ligen