From 646537e19c2a847ee1180c2143c4083fe4fd4c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20L=C3=BCcke?= Date: Mon, 10 Jan 2022 14:47:05 +0100 Subject: [PATCH] Bugfix: Fehler bei nicht vorhandenen Daten beseitigen --- ui/src/routes/WorkingHours/Formular.svelte | 4 ++-- ui/src/routes/WorkingHours/List.svelte | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/routes/WorkingHours/Formular.svelte b/ui/src/routes/WorkingHours/Formular.svelte index c8c1d41..cd78af2 100644 --- a/ui/src/routes/WorkingHours/Formular.svelte +++ b/ui/src/routes/WorkingHours/Formular.svelte @@ -12,10 +12,10 @@ Controller.nextDay() }); }, - 'nextDay': () => { + 'nextDay': async () => { let actDate = new TimekeepingDate(activeRecord.workingDay) let nextDay = actDate.getNextDay() - activeRecord = WorkingHoursRepository.readOrNew(nextDay.getDateString()) + activeRecord = await WorkingHoursRepository.readOrNew(nextDay.getDateString()) }, 'cancelActiveRecord': () => { activeRecord = null; diff --git a/ui/src/routes/WorkingHours/List.svelte b/ui/src/routes/WorkingHours/List.svelte index 741fce3..c6d7a32 100644 --- a/ui/src/routes/WorkingHours/List.svelte +++ b/ui/src/routes/WorkingHours/List.svelte @@ -18,9 +18,9 @@ isLoading = false }); }, - 'newRecord': () => { + 'newRecord': async () => { const actDate = new TimekeepingDate() - activeRecord = WorkingHoursRepository.readOrNew(actDate.getDateString()) + activeRecord = await WorkingHoursRepository.readOrNew(actDate.getDateString()) }, 'selectActiveRecord': record => WorkingHoursRepository.read(record.workingDay).then(data => { if (data === null) {