- Fixed issue with adding new grocery item but without a category always

This commit is contained in:
Dejan
2024-10-26 14:45:52 +02:00
parent 675ecedd86
commit e5d39107d1
3 changed files with 5 additions and 2 deletions

View File

@ -116,6 +116,10 @@ const EditGroceryItem = ({ editGrocery }: { editGrocery: IEditGrocery }) => {
});
console.log("kategorija vo diropdown: " + item.value);
if (editGrocery.closeEdit) editGrocery.closeEdit(false);
} else {
if (editGrocery.setCategory) {
editGrocery.setCategory(item.value);
}
}
}}
/>

View File

@ -32,6 +32,7 @@ const GroceryList = () => {
const [category, setCategory] = useState<GroceryCategory>(
GroceryCategory.None
);
const [title, setTitle] = useState<string>("");
const [submit, setSubmitted] = useState<boolean>(false);