feat: add door_key field to items and update related logic in forms and database
This commit is contained in:
@@ -29,8 +29,8 @@ const AddItemForm: React.FC<AddItemFormProps> = ({ onClose, alert }) => {
|
||||
<Input id="item_name" placeholder="z.B. Laptop" />
|
||||
</Field.Root>
|
||||
<Field.Root>
|
||||
<Field.Label>Schließfachnummer (immer zwei Zahlen)</Field.Label>
|
||||
<Input id="safe_nr" placeholder="Nummer 01 - 06" />
|
||||
<Field.Label>Schließfachnummer</Field.Label>
|
||||
<Input id="safe_nr" placeholder="Nummer 1 - 6" />
|
||||
</Field.Root>
|
||||
<Field.Root>
|
||||
<Field.Label>Ausleih-Berechtigung (Rolle)</Field.Label>
|
||||
@@ -64,7 +64,6 @@ const AddItemForm: React.FC<AddItemFormProps> = ({ onClose, alert }) => {
|
||||
const safeNr = safeNrValue === "" ? null : safeNrValue;
|
||||
|
||||
if (!name || Number.isNaN(role)) return;
|
||||
if (safeNr !== null && !/^\d{2}$/.test(safeNr)) return;
|
||||
|
||||
const res = await createItem(name, role, safeNr);
|
||||
if (res.success) {
|
||||
|
||||
Reference in New Issue
Block a user