index.js
727 Bytes
import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import Layout from "../../../components/layout/Layout";
import MyBookings from "../../../components/user/MyBookings";
import MyEnquires from "../../../components/user/MyEnquires";
import { getEnquiriesByEndUser } from "../../../redux/actions/enquiryAction";
export default function UserMyEnquiresPage() {
const { endUser } = useSelector(state => state.endUser);
console.log("endUser", endUser);
const dispatch = useDispatch();
useEffect(() => {
if (endUser) {
dispatch(getEnquiriesByEndUser({ endUserId: endUser.id }));
}
}, [endUser]);
return (
<Layout>
<MyEnquires />
</Layout>
);
}