cart & checkout: apply validation based on required inputs in each service & add phone input in checkout page
This commit is contained in:
@@ -13,14 +13,14 @@ export default function useOrder() {
|
||||
const { mobilenumber, user_uuid } = JSON.parse(
|
||||
localStorage.getItem("customer") || "{}"
|
||||
) as Customer;
|
||||
const { items, coupon, tip, tables, specialRequest } =
|
||||
const { items, coupon, tip, tables, specialRequest, phone } =
|
||||
useAppSelector(selectCart);
|
||||
|
||||
const [createOrder] = useCreateOrderMutation();
|
||||
|
||||
const handleCreateOrder = useCallback(() => {
|
||||
createOrder({
|
||||
phone: mobilenumber,
|
||||
phone: mobilenumber || phone,
|
||||
couponID: coupon,
|
||||
discountAmount: 0,
|
||||
comment: specialRequest,
|
||||
|
||||
Reference in New Issue
Block a user