Add weekly progress and validation
This commit is contained in:
@@ -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
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user