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) {
|
async function handleSubmit(e: React.FormEvent) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setSaving(true);
|
|
||||||
setError('');
|
setError('');
|
||||||
setSuccess(false);
|
setSuccess(false);
|
||||||
|
|
||||||
|
if (showBesucher && besucher === '') {
|
||||||
|
setError('Bitte Besucherzahl eingeben.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (beginn === ende) {
|
||||||
|
setError('Die Zeite wurden nicht eingegeben');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setSaving(true);
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
Kuppel: kuppel,
|
Kuppel: kuppel,
|
||||||
ArtFuehrung: artFuehrung,
|
ArtFuehrung: artFuehrung,
|
||||||
|
|||||||
@@ -48,7 +48,12 @@ export default function ObjektSelector({ selected, onChange }: Props) {
|
|||||||
function addNew() {
|
function addNew() {
|
||||||
const name = newName.trim();
|
const name = newName.trim();
|
||||||
if (!name || selectedNames.has(name.toLowerCase())) return;
|
if (!name || selectedNames.has(name.toLowerCase())) return;
|
||||||
|
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 }]);
|
onChange([...selected, { ID: null, Name: name }]);
|
||||||
|
}
|
||||||
setNewName('');
|
setNewName('');
|
||||||
setShowNewInput(false);
|
setShowNewInput(false);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -6,9 +6,9 @@ export const KUPPELN: Kuppel[] = ['West', 'Ost', 'Süd', 'Pluto'];
|
|||||||
export const ARTEN_MAP: Record<ArtFuehrung, string> = {
|
export const ARTEN_MAP: Record<ArtFuehrung, string> = {
|
||||||
RF: 'regulär',
|
RF: 'regulär',
|
||||||
SF: 'sonder',
|
SF: 'sonder',
|
||||||
|
SonF: 'sonnen',
|
||||||
PrF: 'privat',
|
PrF: 'privat',
|
||||||
BEOS: '',
|
BEOS: '',
|
||||||
SonF: 'sonnen',
|
|
||||||
TD: '',
|
TD: '',
|
||||||
Beob: 'Beobachtung',
|
Beob: 'Beobachtung',
|
||||||
ToT: '',
|
ToT: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user