schema fix

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Sven laptop
2026-05-05 19:55:51 +02:00
parent c847d32743
commit 8d4e8b3075
7 changed files with 99 additions and 44 deletions
+12 -2
View File
@@ -34,8 +34,14 @@ class _LoginScreenState extends State<LoginScreen> {
});
try {
final input = _userCodeController.text.trim();
final parsedUserCode = int.tryParse(input);
if (parsedUserCode == null) {
throw Exception('User code must be a number');
}
final response = await _authService.login(
userCode: _userCodeController.text.trim(),
userCode: parsedUserCode,
password: _passwordController.text,
);
@@ -57,9 +63,13 @@ class _LoginScreenState extends State<LoginScreen> {
}
String? _validateUserCode(String? value) {
if (value?.isEmpty ?? true) {
final v = value?.trim();
if (v?.isEmpty ?? true) {
return 'User code is required';
}
if (int.tryParse(v!) == null) {
return 'User code must be a number';
}
return null;
}