Add weekly progress and validation

This commit is contained in:
2026-07-10 16:23:50 +02:00
parent 23416ee382
commit 1cdef43a87
6 changed files with 39 additions and 11 deletions
+10 -1
View File
@@ -119,6 +119,16 @@ class HabitController
if ($title === '') {
$errors['title'] = 'Bitte gib einen Namen fuer den Habit ein.';
} elseif (mb_strlen($title) > 120) {
$errors['title'] = 'Der Name darf maximal 120 Zeichen lang sein.';
}
if (mb_strlen($description) > 1000) {
$errors['description'] = 'Die Beschreibung darf maximal 1000 Zeichen lang sein.';
}
if ($categoryId !== '' && !Category::exists((int) $categoryId)) {
$errors['category_id'] = 'Bitte waehle eine gueltige Kategorie aus.';
}
if ($targetPerWeek < 1 || $targetPerWeek > 7) {
@@ -134,4 +144,3 @@ class HabitController
];
}
}