diff --git a/backend/services/accidentService.js b/backend/services/accidentService.js index 3be7273..c2b8437 100644 --- a/backend/services/accidentService.js +++ b/backend/services/accidentService.js @@ -8,8 +8,7 @@ class AccidentService { await checkAccess(userToken, clubId); const user = await getUserByToken(userToken); if (!user) { - console.log('---------------'); - throw new Error('User not found'); + throw new Error('User not found'); } const member = await Member.findByPk(memberId); if (!member || member.clubId != clubId) { diff --git a/frontend/src/views/DiaryView.vue b/frontend/src/views/DiaryView.vue index a46821e..5b06864 100644 --- a/frontend/src/views/DiaryView.vue +++ b/frontend/src/views/DiaryView.vue @@ -32,7 +32,7 @@

Trainingszeiten bearbeiten {{ showGeneralData ? - '-' : '+' }}

+ '-' : '+' }}
@@ -54,7 +54,7 @@
  • {{ group.name - }} + }} @@ -88,6 +88,7 @@ + @@ -98,6 +99,7 @@ + +
    Startzeit Aktivität / Zeitblock Gruppe
    {{ calculateNextTime }} @@ -140,7 +148,7 @@ - @@ -154,7 +162,8 @@
    + @click="generatePDF">Als PDF + herunterladen
@@ -181,9 +190,9 @@ :checked="isParticipant(member.id)"> {{ - member ? member.firstName : '' + member ? member.firstName : '' }} {{ - member ? member.lastName : '' }} + member ? member.lastName : '' }} 📝 🖼 ℹ️ @@ -252,18 +261,21 @@
- +
@@ -856,7 +868,7 @@ export default { return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`; }, calculateDuration() { - const input = this.newPlanItem.durationInput; + const input = this.newPlanItem.durationText; let calculatedDuration = 0; const multiplyPattern = /(\d+)\s*[x*]\s*(\d+)/i; const match = input.match(multiplyPattern); @@ -893,17 +905,17 @@ export default { alert('Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.'); } }, -/* async loadMemberImage(member) { - try { - const response = await apiClient.get(`/clubmembers/image/${this.currentClub}/${member.id}`, { - responseType: 'blob', - }); - const imageUrl = URL.createObjectURL(response.data); - member.imageUrl = imageUrl; - } catch (error) { - member.imageUrl = null; - } - },*/ + /* async loadMemberImage(member) { + try { + const response = await apiClient.get(`/clubmembers/image/${this.currentClub}/${member.id}`, { + responseType: 'blob', + }); + const imageUrl = URL.createObjectURL(response.data); + member.imageUrl = imageUrl; + } catch (error) { + member.imageUrl = null; + } + },*/ async generatePDF() { const pdf = new PDFGenerator(); pdf.addTrainingPlan(this.currentClubName, this.date.date, this.trainingStart, this.trainingEnd, this.trainingPlan); @@ -985,7 +997,7 @@ export default { this.showGeneralData = !this.showGeneralData; }, getFormattedDate(date) { - return (new Date(date)).toLocaleDateString('de-DE', { year: 'numeric', month: '2-digit', day: '2-digit'}); + return (new Date(date)).toLocaleDateString('de-DE', { year: 'numeric', month: '2-digit', day: '2-digit' }); }, editGroup(groupId) { this.editingGroupId = groupId; @@ -998,14 +1010,14 @@ export default { clubid: this.currentClub, dateid: this.date.id, }); - this.editingGroupId = null; + this.editingGroupId = null; } catch (error) { console.error('Fehler beim Speichern der Gruppendaten:', error); alert('Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.'); } }, cancelEditGroup() { - this.editingGroupId = null; + this.editingGroupId = null; }, async openTagInfos(member) { if (!member) { @@ -1029,7 +1041,7 @@ export default { }, async addNewTagForDay(tag) { await apiClient.post(`/diarydatetags/${this.currentClub}`, { - dateId:this.date.id, + dateId: this.date.id, memberId: this.tagHistoryMember.id, tag: tag, }); @@ -1047,7 +1059,7 @@ export default { if (this.timeChecker) clearInterval(this.timeChecker); this.timeChecker = setInterval(() => { const currentTime = new Date().toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit', second: '2-digit' }); - if (!this.trainingStart || ! this.trainingEnd) { + if (!this.trainingStart || !this.trainingEnd) { return; } let startCheckTime = this.trainingStart; @@ -1100,12 +1112,12 @@ export default { let times = []; let currentTime = new Date("2025-01-01 " + this.trainingStart); this.trainingPlan.forEach(item => { - const rawItem = JSON.parse(JSON.stringify(item)); + const rawItem = JSON.parse(JSON.stringify(item)); currentTime.setMinutes(currentTime.getMinutes() + item.duration); times.push(currentTime.toTimeString({ hours: '2-digit', minutes: '2-digit', seconds: '2-digit' }).slice(0, 8)); }); times = [...new Set(times)].sort(); - this.intermediateTimes = times.filter(time => + this.intermediateTimes = times.filter(time => time !== this.trainingStart && time !== this.trainingEnd ); }, @@ -1188,7 +1200,8 @@ h3 { .column:first-child { flex: 1; overflow: hidden; - height: 100%;justify-self: start; + height: 100%; + justify-self: start; display: flex; flex-direction: column; }