Vorherige Änderungen an Formular und Typen nachcommittet
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
@@ -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: '',
|
||||
|
||||
Reference in New Issue
Block a user