fixed bugs

This commit is contained in:
2025-11-23 21:39:18 +01:00
parent 4b9f55268c
commit 85e6d7fe00
5 changed files with 22 additions and 9 deletions

View File

@@ -68,7 +68,7 @@ const ItemTable: React.FC = () => {
const handleLockerNumberChange = (id: number, value: string) => {
setItems((prev) =>
prev.map((it) => (it.id === id ? { ...it, lockerNumber: value } : it))
prev.map((it) => (it.id === id ? { ...it, safe_nr: value } : it))
);
};

View File

@@ -200,7 +200,6 @@ export const handleEditItems = async (
safe_nr: string | null,
can_borrow_role: string
) => {
const newSafeNr = Number(safe_nr || 0);
try {
const response = await fetch(
`${API_BASE}/api/admin/item-data/edit-item/${itemId}`,
@@ -210,7 +209,7 @@ export const handleEditItems = async (
"Content-Type": "application/json",
Authorization: `Bearer ${Cookies.get("token")}`,
},
body: JSON.stringify({ item_name, newSafeNr, can_borrow_role }),
body: JSON.stringify({ item_name, safe_nr, can_borrow_role }),
}
);
if (!response.ok) {