fix: improve error handling for CSV import in upload and ScheduleView
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user