split bill: reorder flow

This commit is contained in:
2025-12-26 00:25:26 +03:00
parent 86c12e2c53
commit b261f3508f
12 changed files with 656 additions and 551 deletions

View File

@@ -6,13 +6,24 @@ import { useTranslation } from "react-i18next";
import { useAppSelector } from "redux/hooks";
import { selectCart } from "features/order/orderSlice";
import { useNavigate, useParams } from "react-router-dom";
import { useGetOrderDetailsQuery } from "redux/api/others";
export default function BriefMenuCard() {
const { t } = useTranslation();
const { items } = useAppSelector(selectCart);
const totalItems = items.length;
const { subdomain } = useParams();
const { subdomain, orderId } = useParams();
const navigate = useNavigate();
const { data: orderDetails } = useGetOrderDetailsQuery(
{
orderID: orderId || "",
restaurantID: localStorage.getItem("restaurantID") || "",
},
{
skip: !orderId,
// return it t0 60000 after finish testing
},
);
const totalItems = items.length || orderDetails?.orderItems.length;
return (
<>