fix(5): validate part_number is non-empty before transformation
This commit is contained in:
@@ -170,6 +170,9 @@ export default function InventoryPage() {
|
||||
if (!selectedItem) return;
|
||||
try {
|
||||
const updated = { ...selectedItem, ...editedItem };
|
||||
if (updated.part_number && updated.part_number.trim().length === 0) {
|
||||
throw new Error("Part number cannot be empty");
|
||||
}
|
||||
if (updated.part_number) updated.part_number = updated.part_number.toUpperCase();
|
||||
|
||||
await db.items.update(selectedItem.id!, updated);
|
||||
|
||||
Reference in New Issue
Block a user