Bugfix: Fehler bei nicht vorhandenen Daten beseitigen

This commit is contained in:
2022-01-10 14:47:05 +01:00
parent efadeb501b
commit 646537e19c
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -12,10 +12,10 @@
Controller.nextDay() Controller.nextDay()
}); });
}, },
'nextDay': () => { 'nextDay': async () => {
let actDate = new TimekeepingDate(activeRecord.workingDay) let actDate = new TimekeepingDate(activeRecord.workingDay)
let nextDay = actDate.getNextDay() let nextDay = actDate.getNextDay()
activeRecord = WorkingHoursRepository.readOrNew(nextDay.getDateString()) activeRecord = await WorkingHoursRepository.readOrNew(nextDay.getDateString())
}, },
'cancelActiveRecord': () => { 'cancelActiveRecord': () => {
activeRecord = null; activeRecord = null;
+2 -2
View File
@@ -18,9 +18,9 @@
isLoading = false isLoading = false
}); });
}, },
'newRecord': () => { 'newRecord': async () => {
const actDate = new TimekeepingDate() const actDate = new TimekeepingDate()
activeRecord = WorkingHoursRepository.readOrNew(actDate.getDateString()) activeRecord = await WorkingHoursRepository.readOrNew(actDate.getDateString())
}, },
'selectActiveRecord': record => WorkingHoursRepository.read(record.workingDay).then(data => { 'selectActiveRecord': record => WorkingHoursRepository.read(record.workingDay).then(data => {
if (data === null) { if (data === null) {