Skip to content

Commit

Permalink
#93 frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
fdhhhdjd committed Nov 4, 2022
1 parent 55985ba commit 4c7444a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Binary file modified dump.rdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const Cart_User = () => {
}
return dispatch(reset_change_error());
}, [error]);

return (
<React.Fragment>
<nav aria-label="breadcrumb" className="main-breadcrumb mt-4">
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/v1/user_ui/components/Products/Detail_Product.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Detail_Product = () => {
...state.Cart_user,
}));

const handleAddToCart = useCallback((product_id, quantity) => {
const handleAddToCart = (product_id, quantity) => {
const checkCart = cart?.some((rs) => product_id === rs.product_id[0]._id);
if (checkCart) {
HandleIncrement(product_id, quantity);
Expand All @@ -48,7 +48,7 @@ const Detail_Product = () => {
Add_To_Cart_Initial({ product_id, quantity, accessToken })
);
}
}, [change_cart]);
};
const HandleIncrement = useCallback((product_id) => {
return dispatch(
Increment_Quantity_Cart_Initial({
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/v1/user_ui/pages/Order_Screen/Order_Screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Order_Screen = () => {
const [quantity, setQuantity] = useState(0);
const dispatch = useDispatch();
const { id } = useParams();
const { order_detail, loading } = useSelector((state) => ({ ...state.order_user }))
const { order_detail, loading, stock_transaction } = useSelector((state) => ({ ...state.order_user }))
const navigate = useNavigate();
const accessToken = STORAGES.getLocalStorage("accessToken");

Expand All @@ -21,7 +21,6 @@ const Order_Screen = () => {
setQuantity(total);
}, [order_detail]);


useEffect(() => {
if (id) {
dispatch(Detail_History_Order_Initial({ id, accessToken }))
Expand Down

0 comments on commit 4c7444a

Please sign in to comment.