added inpu elemts and backend API routes for changing the item table

This commit is contained in:
2025-09-11 16:40:31 +02:00
parent e198fce791
commit 755ebfd06b
4 changed files with 97 additions and 3 deletions

View File

@@ -438,3 +438,12 @@ export const changeUserPasswordFRONTEND = async (
if (result.affectedRows > 0) return { success: true };
return { success: false };
};
export const updateItemByID = async (itemId, item_name, can_borrow_role) => {
const [result] = await pool.query(
"UPDATE items SET item_name = ?, can_borrow_role = ? WHERE id = ?",
[item_name, can_borrow_role, itemId]
);
if (result.affectedRows > 0) return { success: true };
return { success: false };
};