Vorherige Änderungen an Formular und Typen nachcommittet

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 09:37:11 +02:00
parent 3fc5c9ff7a
commit 4f1ebb8aa6
3 changed files with 18 additions and 3 deletions
+11 -1
View File
@@ -137,10 +137,20 @@ export default function LogbuchForm({ kuppel, currentUserBeo, editEntry, onSaved
async function handleSubmit(e: React.FormEvent) {
e.preventDefault();
setSaving(true);
setError('');
setSuccess(false);
if (showBesucher && besucher === '') {
setError('Bitte Besucherzahl eingeben.');
return;
}
if (beginn === ende) {
setError('Die Zeite wurden nicht eingegeben');
return;
}
setSaving(true);
const body = {
Kuppel: kuppel,
ArtFuehrung: artFuehrung,
+6 -1
View File
@@ -48,7 +48,12 @@ export default function ObjektSelector({ selected, onChange }: Props) {
function addNew() {
const name = newName.trim();
if (!name || selectedNames.has(name.toLowerCase())) return;
onChange([...selected, { ID: null, Name: name }]);
const existing = all.find((o) => o.Name.toLowerCase() === name.toLowerCase());
if (existing) {
onChange([...selected, { ID: existing.ID, Name: existing.Name }]);
} else {
onChange([...selected, { ID: null, Name: name }]);
}
setNewName('');
setShowNewInput(false);
}
+1 -1
View File
@@ -6,9 +6,9 @@ export const KUPPELN: Kuppel[] = ['West', 'Ost', 'Süd', 'Pluto'];
export const ARTEN_MAP: Record<ArtFuehrung, string> = {
RF: 'regulär',
SF: 'sonder',
SonF: 'sonnen',
PrF: 'privat',
BEOS: '',
SonF: 'sonnen',
TD: '',
Beob: 'Beobachtung',
ToT: '',