fix quantiti

This commit is contained in:
hamid zarghami
2026-01-26 12:48:57 +03:30
parent 3fb908936e
commit 155e1e0b20
2 changed files with 14 additions and 1 deletions
+6 -1
View File
@@ -38,11 +38,16 @@ const Order: FC = () => {
const productId = e.target.value
const product = data?.data?.find(o => Number(o.id) === Number(productId))
if (product) {
product.quantities.unshift(0)
if (product.quantities[0] !== 0) {
product.quantities.unshift(0)
}
setProductSelected(product)
}
}
console.log(productSelected?.quantities);
// const handleChangeAttribute = (e: ChangeEvent<HTMLSelectElement>) => {
// const attributeId = e.target.value
// const attribute = productSelected?.attributes?.find(o => Number(o.id) === Number(attributeId))
+8
View File
@@ -0,0 +1,8 @@
import { create } from "zustand";
export const useAuthStore = create((set) => ({
phone: "",
setPhone(value) {
set({ phone: value });
},
}));