Commit d53a7dc4 by sneha-khedekar

conflicts fixed

2 parents 725602b6 cdf775d8
...@@ -6,8 +6,8 @@ import { DownCircleOutlined, MoreOutlined } from "@ant-design/icons"; ...@@ -6,8 +6,8 @@ import { DownCircleOutlined, MoreOutlined } from "@ant-design/icons";
import { getSession } from "next-auth/react"; import { getSession } from "next-auth/react";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
const GiftcardListing = () => { const GiftcardListing = () => {
const [session, setSession] = useState();
const [update, setupdate] = useState(false); const [update, setupdate] = useState(false);
const [session, setSession] = useState();
useEffect(() => { useEffect(() => {
const fetchSession = async () => { const fetchSession = async () => {
setSession(await getSession()); setSession(await getSession());
......
...@@ -16,6 +16,7 @@ import Link from "next/link.js"; ...@@ -16,6 +16,7 @@ import Link from "next/link.js";
import { checkWishlist, toggleWishlist } from "../../redux/actions/activityAction.js"; import { checkWishlist, toggleWishlist } from "../../redux/actions/activityAction.js";
import WishlistComponent from "./WIshlistComponent.js"; import WishlistComponent from "./WIshlistComponent.js";
import ShareWidget from "./ShareWidget.js"; import ShareWidget from "./ShareWidget.js";
import { sanitizeTimeRange } from "../../services/imageHandling";
const DetailInfo = ({ activityById }) => { const DetailInfo = ({ activityById }) => {
const router = useRouter(); const router = useRouter();
...@@ -71,7 +72,7 @@ const DetailInfo = ({ activityById }) => { ...@@ -71,7 +72,7 @@ const DetailInfo = ({ activityById }) => {
<div className="product-info"> <div className="product-info">
<div className="hide-on-mobile"> <div className="hide-on-mobile">
<div className="top-row"> <div className="top-row">
<div className="most-booked">Most Booked</div> <div className="most-booked"></div>
<div className="wishlist-share"> <div className="wishlist-share">
{endUser && <WishlistComponent activityId={activityById.data.id} userId={endUser.id} />} {endUser && <WishlistComponent activityId={activityById.data.id} userId={endUser.id} />}
...@@ -95,13 +96,15 @@ const DetailInfo = ({ activityById }) => { ...@@ -95,13 +96,15 @@ const DetailInfo = ({ activityById }) => {
</motion.div> </motion.div>
</div> </div>
<div className="product-reviews"> <div className="product-reviews">
<div className="rating"> {activityById.data.attributes.reviews.data && activityById.data.attributes.reviews.data.length > 0 && (
<span className="number">{calculateRating(activityById.data.attributes.reviews.data)}</span> <div className="rating">
<span className="image-container"> <span className="number">{calculateRating(activityById.data.attributes.reviews.data)}</span>
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" /> <span className="image-container">
{/* {calculateRating(activityById.data.attributes.reviews.data)} */} <Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
</span> {/* {calculateRating(activityById.data.attributes.reviews.data)} */}
</div> </span>
</div>
)}
<span className="review">{activityById.data.attributes.reviews.data.length > 0 ? activityById.data.attributes.reviews.data.length : 0} Review(s)</span> <span className="review">{activityById.data.attributes.reviews.data.length > 0 ? activityById.data.attributes.reviews.data.length : 0} Review(s)</span>
</div> </div>
<div className="mb-2">Per Person</div> <div className="mb-2">Per Person</div>
...@@ -182,7 +185,9 @@ const DetailInfo = ({ activityById }) => { ...@@ -182,7 +185,9 @@ const DetailInfo = ({ activityById }) => {
setenquiryModal; setenquiryModal;
}} }}
> >
<Modal.Header><h4>Send Enquiry</h4></Modal.Header> <Modal.Header>
<h4>Send Enquiry</h4>
</Modal.Header>
<Modal.Body> <Modal.Body>
<div>Experience Name:</div> <div>Experience Name:</div>
<div className="" style={{ fontSize: "22px", fontWeight: "bold" }}> <div className="" style={{ fontSize: "22px", fontWeight: "bold" }}>
...@@ -211,14 +216,16 @@ const DetailInfo = ({ activityById }) => { ...@@ -211,14 +216,16 @@ const DetailInfo = ({ activityById }) => {
<div className="mt-2">Date:</div> <div className="mt-2">Date:</div>
<div className=""> <div className="">
<DatePicker popupStyle={{ <DatePicker
position: "fixed", zIndex: 9999 popupStyle={{
}} position: "fixed",
zIndex: 9999
}}
onChange={e => { onChange={e => {
e.preventDefault(); console.log(sanitizeTimeRange({ data: e }));
console.log(e); // e.preventDefault();
// setenquireDate(e) // console.log(e);
setenquireDate(sanitizeTimeRange({ data: e }));
}} }}
/> />
</div> </div>
...@@ -230,7 +237,9 @@ const DetailInfo = ({ activityById }) => { ...@@ -230,7 +237,9 @@ const DetailInfo = ({ activityById }) => {
onClick={async () => { onClick={async () => {
setloading(true); setloading(true);
console.log("hello"); console.log("hello");
let res = await sendEnquiry({ activityId: activityById.data.id, userId: endUser.id, vendorId: activityById.data.attributes.vendor.data.id, quantity }); if (!enquireDate) toast.error("Please select date!")
if (!quantity) toast.error("Please select quantity!")
let res = await sendEnquiry({ activityId: activityById.data.id, userId: endUser.id, vendorId: activityById.data.attributes.vendor.data.id, quantity, date: enquireDate });
console.log("res", res); console.log("res", res);
toast.success("Enquiry sent successfully, our team will get back to you shortly! Thank you!"); toast.success("Enquiry sent successfully, our team will get back to you shortly! Thank you!");
setloading(false); setloading(false);
......
...@@ -14,8 +14,6 @@ import { postGiftCard } from "../../redux/actions/giftCardAction"; ...@@ -14,8 +14,6 @@ import { postGiftCard } from "../../redux/actions/giftCardAction";
// import { getCurrentEndUser } from "../../redux/actions/userActions"; // import { getCurrentEndUser } from "../../redux/actions/userActions";
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
customAmt: Yup.string().required("Full name is required"),
code: Yup.string().required("Please Enter 4-Digit Code"),
email: Yup.string().email("Invalid email").required("Email is required"), email: Yup.string().email("Invalid email").required("Email is required"),
receiverEmail: Yup.string().email("Invalid email").required("Email is required"), receiverEmail: Yup.string().email("Invalid email").required("Email is required"),
message: Yup.string().required("Message is required") message: Yup.string().required("Message is required")
...@@ -97,6 +95,7 @@ const GiftCard = () => { ...@@ -97,6 +95,7 @@ const GiftCard = () => {
</a> </a>
</div> */} </div> */}
<Formik <Formik
validationSchema={validationSchema}
initialValues={{ initialValues={{
customAmt: "", customAmt: "",
email: "", email: "",
...@@ -310,7 +309,7 @@ const GiftCard = () => { ...@@ -310,7 +309,7 @@ const GiftCard = () => {
setIsStep2(true); setIsStep2(true);
setIsStep1(false); setIsStep1(false);
}} }}
disabled={!amount > 0 || !values.receiverEmail || !values.email} disabled={!amount > 0 || !values.receiverEmail || !values.email || errors.email || errors.receiverEmail || errors.message}
> >
{loading ? <Loader /> : "Continue"} {loading ? <Loader /> : "Continue"}
</button> </button>
...@@ -329,13 +328,13 @@ const GiftCard = () => { ...@@ -329,13 +328,13 @@ const GiftCard = () => {
{isStep2 && ( {isStep2 && (
<div className="gift-card-rt"> <div className="gift-card-rt">
<div className="back-btn"> {/* <div className="back-btn">
<a href=""> <a href="">
<span className="image-container"> <span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/arrow-left-02.svg" /> <Image layout="fill" alt="" className="image img-fluid" src="/images/icons/arrow-left-02.svg" />
</span> </span>
</a> </a>
</div> </div> */}
<Formik <Formik
initialValues={{ initialValues={{
code: "" code: ""
...@@ -345,27 +344,25 @@ const GiftCard = () => { ...@@ -345,27 +344,25 @@ const GiftCard = () => {
// Handle form submission here // Handle form submission here
console.log(values); console.log(values);
setSubmitting(false); setSubmitting(false);
setIsStep2(false);
setIsStep1(false);
setIsResult(true);
}} }}
> >
{({ isSubmitting, values, handleChange, handleBlur, touched, errors }) => ( {({ isSubmitting, values, handleChange, handleBlur, touched, errors }) => (
<Form action="" className="form-01"> <Form action="" className="form-01">
<div className="title">We emailed you a 4-digit code</div> <div className="title">We emailed you a 4-digit code</div>
{/* <div className="cl-gry">Please enter it below to create or login into your account:</div> */} {/* <div className="cl-gry">Please enter it below to create or login into your account:</div> */}
{console.log("values", form1Values)} {/* {console.log("values", form1Values)} */}
<div className="row mt-4"> <div className="row mt-4">
<div className="col-md-12 mb-4"> <div className="col-md-12 mb-4">
<label htmlFor="">Enter 4-Digit Code</label> <label htmlFor="">Enter 4-Digit Code</label>
<Field <Field
className="form-control" className="form-control"
type="text" type="number"
name="code" name="code"
placeholder="Enter the code we emailed you" placeholder="Enter the code we emailed you"
onChange={handleChange} onChange={handleChange}
onBlur={handleBlur} onBlur={handleBlur}
value={values.code} value={values.code}
/> />
{touched.code && errors.code && <div className="text-danger">{errors.code}</div>} {touched.code && errors.code && <div className="text-danger">{errors.code}</div>}
{/* <div className="link-a"> {/* <div className="link-a">
...@@ -382,7 +379,10 @@ const GiftCard = () => { ...@@ -382,7 +379,10 @@ const GiftCard = () => {
console.log("res", res.data); console.log("res", res.data);
if (!res.data.ok) { if (!res.data.ok) {
toast.error(res.data.message); toast.error(res.data.message);
// console.log("here");
return;
} }
if (res.data.ok) { if (res.data.ok) {
const response = await postGiftCard({ const response = await postGiftCard({
data: { data: {
...@@ -397,10 +397,13 @@ const GiftCard = () => { ...@@ -397,10 +397,13 @@ const GiftCard = () => {
} }
}); });
console.log("response", response); console.log("response", response);
setIsStep2(false);
setIsStep1(false);
setIsResult(true);
toast.success("OTP verified!"); toast.success("OTP verified!");
} }
}} }}
disabled={isSubmitting} disabled={!values.code || String(values.code).length < 4}
> >
Confirm Confirm
</button> </button>
......
...@@ -116,7 +116,7 @@ const BrowseExperiences = ({ allActivitiesData }) => { ...@@ -116,7 +116,7 @@ const BrowseExperiences = ({ allActivitiesData }) => {
</div> </div>
</div> </div>
<div className="discription"> <div className="discription">
<span>{data?.attributes?.description.slice(0, 52)}... <a href="/detail">Read More</a></span> <span>{data?.attributes?.description.slice(0, 52)}... <Link href={`/activities/${data.id}`} prefetch>Read More</Link></span>
</div> </div>
<div className="price"> <div className="price">
......
...@@ -21,10 +21,10 @@ const Home = () => { ...@@ -21,10 +21,10 @@ const Home = () => {
const { testimonial } = useSelector(sate => sate.testimonial); const { testimonial } = useSelector(sate => sate.testimonial);
const { allActivitiesData } = useSelector(sate => sate.allActivitiesData); const { allActivitiesData } = useSelector(sate => sate.allActivitiesData);
const { homeBanner } = useSelector(state => state.homeBanner); const { homeBanner } = useSelector(state => state.homeBanner);
console.log("homeBanner", homeBanner); // console.log("homeBanner", homeBanner);
console.log("categories", categories); // console.log("categories", categories);
console.log("testimonial", testimonial); // console.log("testimonial", testimonial);
console.log("allActivitiesData", allActivitiesData); // console.log("allActivitiesData", allActivitiesData);
const dispatch = useDispatch(); const dispatch = useDispatch();
useEffect(() => { useEffect(() => {
// dispatch(getHomePage()) // dispatch(getHomePage())
......
...@@ -45,11 +45,14 @@ const Header = () => { ...@@ -45,11 +45,14 @@ const Header = () => {
useEffect(() => { useEffect(() => {
dispatch(getCurrentEndUser()); dispatch(getCurrentEndUser());
}, []); }, []);
useEffect(() => {
dispatch(getCurrentEndUser());
}, [router]);
useEffect(() => { useEffect(() => {
if (endUser) dispatch(getWishlists({ endUser: endUser.id })); if (endUser) dispatch(getWishlists({ endUser: endUser.id }));
}, [endUser]); }, [endUser]);
// console.log("endUser", endUser);
//// ////
// const [isGridViewOpen, setIsGridViewOpen] = useState(false); // const [isGridViewOpen, setIsGridViewOpen] = useState(false);
const innerBoxRef = useRef(null); // Ref to hold reference to inner-box div const innerBoxRef = useRef(null); // Ref to hold reference to inner-box div
...@@ -98,19 +101,21 @@ const Header = () => { ...@@ -98,19 +101,21 @@ const Header = () => {
</a> </a>
{/* <p>{loadedUser.phone}</p> */} {/* <p>{loadedUser.phone}</p> */}
<div ref={logoutBkRef} className={`inner-box ${isGridViewOpen ? "open" : ""}`}> <div ref={logoutBkRef} className={`inner-box ${isGridViewOpen ? "open" : ""}`}>
<div className="user-info"> {endUser && (
<div className="pic"> <div className="user-info">
<span className="image-container"> <div className="pic">
<Image layout="fill" priority alt="" className="image img-fluid" src="/images/icons/user.svg" /> <span className="image-container">
</span> <Image layout="fill" priority alt="" className="image img-fluid" src="/images/icons/user.svg" />
</div> </span>
<div className=""> </div>
<div className="name">John Doe</div> <div className="">
<div className="view-profile"> <div className="name">{endUser.attributes.name}</div>
<a href="/user/profile">View Profile</a> <div className="view-profile">
<a href="/user/profile">View Profile</a>
</div>
</div> </div>
</div> </div>
</div> )}
<div className="user-item"> <div className="user-item">
<ul> <ul>
<li> <li>
...@@ -281,7 +286,7 @@ const Header = () => { ...@@ -281,7 +286,7 @@ const Header = () => {
</Form> </Form>
{!loading ? ( {!loading ? (
<> <>
{loadedUser && loadedUser.id ? ( {endUser && endUser.id ? (
<div className="top-btn hide-on-mobile"> <div className="top-btn hide-on-mobile">
<div className="logout-bk"> <div className="logout-bk">
<a onClick={toggleGridViewDropdown} className="user-icon"> <a onClick={toggleGridViewDropdown} className="user-icon">
...@@ -300,12 +305,14 @@ const Header = () => { ...@@ -300,12 +305,14 @@ const Header = () => {
<Image layout="fill" priority alt="" className="image img-fluid" src="/images/icons/user.svg" /> <Image layout="fill" priority alt="" className="image img-fluid" src="/images/icons/user.svg" />
</span> </span>
</div> </div>
<div className=""> {endUser && (
<div className="name">John Doe</div> <div className="">
<div className="view-profile"> <div className="name">{endUser.attributes.name}</div>
<a href="/user/profile">View Profile</a> <div className="view-profile">
<a href="/user/profile">View Profile</a>
</div>
</div> </div>
</div> )}
</div> </div>
<div className="user-item"> <div className="user-item">
<ul> <ul>
......
...@@ -15,6 +15,7 @@ const ListingFilter = () => { ...@@ -15,6 +15,7 @@ const ListingFilter = () => {
const [showContent, setShowContent] = useState(false); const [showContent, setShowContent] = useState(false);
const [sliderLowerValue, setsliderLowerValue] = useState(0); const [sliderLowerValue, setsliderLowerValue] = useState(0);
const [sliderUpperValue, setsliderUpperValue] = useState(5000); const [sliderUpperValue, setsliderUpperValue] = useState(5000);
const [ageState, setageState] = useState("Select age, Click menu item");
const dispatch = useDispatch(); const dispatch = useDispatch();
const { activityFilters } = useSelector(sate => sate.activityFilters); const { activityFilters } = useSelector(sate => sate.activityFilters);
const { subCategories, loading } = useSelector(sate => sate.subCategories); const { subCategories, loading } = useSelector(sate => sate.subCategories);
...@@ -37,6 +38,7 @@ const ListingFilter = () => { ...@@ -37,6 +38,7 @@ const ListingFilter = () => {
// message.info(`Click on item ${key}`); // message.info(`Click on item ${key}`);
console.log("key", key, suitableAgeGroups[key - 1]); console.log("key", key, suitableAgeGroups[key - 1]);
dispatch(setActivityFilters({ filters: { ...activityFilters, minAge: suitableAgeGroups[key - 1] } })); dispatch(setActivityFilters({ filters: { ...activityFilters, minAge: suitableAgeGroups[key - 1] } }));
setageState(items[key - 1].label)
}; };
const items = [ const items = [
{ {
...@@ -409,7 +411,7 @@ const ListingFilter = () => { ...@@ -409,7 +411,7 @@ const ListingFilter = () => {
> >
<a onClick={e => e.preventDefault()}> <a onClick={e => e.preventDefault()}>
<Space> <Space>
Select age, Click menu item {ageState}
<DownOutlined /> <DownOutlined />
</Space> </Space>
</a> </a>
......
...@@ -3,17 +3,21 @@ import { useDispatch } from "react-redux"; ...@@ -3,17 +3,21 @@ import { useDispatch } from "react-redux";
import Detail from "../../components/detail/Detail"; import Detail from "../../components/detail/Detail";
import Layout from "../../components/layout/Layout"; import Layout from "../../components/layout/Layout";
import { getActivityById } from "../../redux/actions/activityAction"; import { getActivityById } from "../../redux/actions/activityAction";
import { loadUser } from "../../redux/actions/userActions"; import { getCurrentEndUser, loadUser } from "../../redux/actions/userActions";
import { wrapper } from "../../redux/store"; import { wrapper } from "../../redux/store";
import { getFaqs } from "../../redux/actions/faqsAction"; import { getFaqs } from "../../redux/actions/faqsAction";
import { getReviewsAction } from "../../redux/actions/reviewsAction"; import { getReviewsAction } from "../../redux/actions/reviewsAction";
import { useRouter } from "next/router";
const ActivityDetailPage = () => { const ActivityDetailPage = () => {
const router = useRouter()
const dispatch = useDispatch(); const dispatch = useDispatch();
useEffect(() => { useEffect(() => {
dispatch(loadUser()); dispatch(loadUser());
}, []); }, []);
useEffect(() => {
dispatch(getCurrentEndUser());
}, [router]);
return ( return (
<Layout> <Layout>
<Detail /> <Detail />
......
import React from "react"; import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import Layout from "../../../components/layout/Layout"; import Layout from "../../../components/layout/Layout";
import MyBookings from "../../../components/user/MyBookings"; import MyBookings from "../../../components/user/MyBookings";
import MyEnquires from "../../../components/user/MyEnquires"; import MyEnquires from "../../../components/user/MyEnquires";
import { getEnquiriesByEndUser } from "../../../redux/actions/enquiryAction";
export default function UserMyEnquiresPage() { 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>
);
};
\ No newline at end of file \ No newline at end of file
return (
<Layout>
<MyEnquires />
</Layout>
);
}
...@@ -8,6 +8,9 @@ import { ...@@ -8,6 +8,9 @@ import {
GET_ENQUIRIES_BY_ADMIN_FAIL, GET_ENQUIRIES_BY_ADMIN_FAIL,
GET_ENQUIRIES_BY_ADMIN_REQUEST, GET_ENQUIRIES_BY_ADMIN_REQUEST,
GET_ENQUIRIES_BY_ADMIN_SUCCESS, GET_ENQUIRIES_BY_ADMIN_SUCCESS,
GET_ENQUIRIES_BY_ENDUSER_FAIL,
GET_ENQUIRIES_BY_ENDUSER_REQUEST,
GET_ENQUIRIES_BY_ENDUSER_SUCCESS,
GET_ENQUIRIES_BY_VENDOR_FAIL, GET_ENQUIRIES_BY_VENDOR_FAIL,
GET_ENQUIRIES_BY_VENDOR_REQUEST, GET_ENQUIRIES_BY_VENDOR_REQUEST,
GET_ENQUIRIES_BY_VENDOR_SUCCESS GET_ENQUIRIES_BY_VENDOR_SUCCESS
...@@ -148,6 +151,57 @@ export const getEnquiriesByAdmin = () => async dispatch => { ...@@ -148,6 +151,57 @@ export const getEnquiriesByAdmin = () => async dispatch => {
}); });
} }
}; };
export const getEnquiriesByEndUser =
({ endUserId }) =>
async dispatch => {
try {
dispatch({
type: GET_ENQUIRIES_BY_ENDUSER_REQUEST,
loading: true
});
const session = await getSession();
if (!session) {
return;
}
const config = {
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${session.jwt}`
}
};
console.log("res enq");
const query = {
filters: {
end_user: {
id: {
$eq: endUserId
}
}
},
populate: ["vendor", "experience", "end_user", "experience.image", "experience.reviews"],
sort: ["createdAt:desc"]
};
const queryString = qs.stringify(query, {
encodeValuesOnly: true
});
const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/enquires/?${queryString}`, config);
dispatch({
type: GET_ENQUIRIES_BY_ENDUSER_SUCCESS,
payload: response.data.data,
loading: false
});
} catch (error) {
dispatch({
type: GET_ENQUIRIES_BY_ENDUSER_FAIL,
payload: error.response.data
});
}
};
export const changeEnquiryStatus = async ({ status, id }) => { export const changeEnquiryStatus = async ({ status, id }) => {
try { try {
const session = await getSession(); const session = await getSession();
......
...@@ -10,6 +10,10 @@ export const GET_ENQUIRIES_BY_ADMIN_REQUEST = "GET_ENQUIRIES_BY_ADMIN_REQUEST"; ...@@ -10,6 +10,10 @@ export const GET_ENQUIRIES_BY_ADMIN_REQUEST = "GET_ENQUIRIES_BY_ADMIN_REQUEST";
export const GET_ENQUIRIES_BY_ADMIN_SUCCESS = "GET_ENQUIRIES_BY_ADMIN_SUCCESS"; export const GET_ENQUIRIES_BY_ADMIN_SUCCESS = "GET_ENQUIRIES_BY_ADMIN_SUCCESS";
export const GET_ENQUIRIES_BY_ADMIN_FAIL = "GET_ENQUIRIES_BY_ADMIN_FAIL"; export const GET_ENQUIRIES_BY_ADMIN_FAIL = "GET_ENQUIRIES_BY_ADMIN_FAIL";
export const GET_ENQUIRIES_BY_ENDUSER_REQUEST = "GET_ENQUIRIES_BY_ENDUSER_REQUEST";
export const GET_ENQUIRIES_BY_ENDUSER_SUCCESS = "GET_ENQUIRIES_BY_ENDUSER_SUCCESS";
export const GET_ENQUIRIES_BY_ENDUSER_FAIL = "GET_ENQUIRIES_BY_ENDUSER_FAIL";
export const CLEAR_ERRORS = "CLEAR_ERRORS"; export const CLEAR_ERRORS = "CLEAR_ERRORS";
// export const TOGGLE_SUCCESS // export const TOGGLE_SUCCESS
\ No newline at end of file \ No newline at end of file
...@@ -5,6 +5,9 @@ import { ...@@ -5,6 +5,9 @@ import {
GET_ENQUIRIES_BY_ADMIN_FAIL, GET_ENQUIRIES_BY_ADMIN_FAIL,
GET_ENQUIRIES_BY_ADMIN_REQUEST, GET_ENQUIRIES_BY_ADMIN_REQUEST,
GET_ENQUIRIES_BY_ADMIN_SUCCESS, GET_ENQUIRIES_BY_ADMIN_SUCCESS,
GET_ENQUIRIES_BY_ENDUSER_FAIL,
GET_ENQUIRIES_BY_ENDUSER_REQUEST,
GET_ENQUIRIES_BY_ENDUSER_SUCCESS,
GET_ENQUIRIES_BY_VENDOR_FAIL, GET_ENQUIRIES_BY_VENDOR_FAIL,
GET_ENQUIRIES_BY_VENDOR_REQUEST, GET_ENQUIRIES_BY_VENDOR_REQUEST,
GET_ENQUIRIES_BY_VENDOR_SUCCESS GET_ENQUIRIES_BY_VENDOR_SUCCESS
...@@ -78,3 +81,26 @@ export const getEnquiriesByVendorReducer = (state = { enquiriesByAdmin: null }, ...@@ -78,3 +81,26 @@ export const getEnquiriesByVendorReducer = (state = { enquiriesByAdmin: null },
return state; return state;
} }
}; };
export const getEnquiriesByEndUserReducer = (state = { enquiriesByEndUser: null }, action) => {
switch (action.type) {
case GET_ENQUIRIES_BY_ENDUSER_REQUEST:
return {
loading: true
};
case GET_ENQUIRIES_BY_ENDUSER_SUCCESS:
return {
loading: false,
enquiriesByEndUser: action.payload
};
case GET_ENQUIRIES_BY_ENDUSER_FAIL:
return {
loading: false,
error: action.payload.error.message
};
default:
return state;
}
};
...@@ -2,10 +2,17 @@ import { combineReducers } from "redux"; ...@@ -2,10 +2,17 @@ import { combineReducers } from "redux";
import { projectReducer, projectsReducer, similarProjectsReducer } from "./projectsReducer"; import { projectReducer, projectsReducer, similarProjectsReducer } from "./projectsReducer";
import { townshipReducer, townshipsReducer } from "./townshipsReducer"; import { townshipReducer, townshipsReducer } from "./townshipsReducer";
import { authReducer, forgotPasswordReducer, getEndUserReducer, loadedUserReducer, resetPasswordReducer, userReducer } from "./userReducers"; import { authReducer, forgotPasswordReducer, getEndUserReducer, loadedUserReducer, resetPasswordReducer, userReducer } from "./userReducers";
import { enquiryReducer, getEnquiriesByVendorReducer, getEnquiriesReducer } from "./enquiryReducer"; import { enquiryReducer, getEnquiriesByEndUserReducer, getEnquiriesByVendorReducer, getEnquiriesReducer } from "./enquiryReducer";
import { displayEnquireNowReducer } from "./enquireNowModalReducer"; import { displayEnquireNowReducer } from "./enquireNowModalReducer";
import { getAllVendorsReducer, getVendorDetailsReducer, loggedInVendorReducer, updateVendorReducer } from "./vendorReducers"; import { getAllVendorsReducer, getVendorDetailsReducer, loggedInVendorReducer, updateVendorReducer } from "./vendorReducers";
import { createActivityReducer, getActivitiesReducer, getActivityByIdReducer, getWishlistsReducer, setActivityFilterReducer, updateActivityByIdReducer } from "./activitiesReducer"; import {
createActivityReducer,
getActivitiesReducer,
getActivityByIdReducer,
getWishlistsReducer,
setActivityFilterReducer,
updateActivityByIdReducer
} from "./activitiesReducer";
import { getAllCategoriesReducer, getAllSubCategoriesReducer } from "./categoryReducer"; import { getAllCategoriesReducer, getAllSubCategoriesReducer } from "./categoryReducer";
import { getAllTestimonialReducer } from "./testimonialReducer"; import { getAllTestimonialReducer } from "./testimonialReducer";
import { blogReducer, blogsReducer } from "./blogReducer"; import { blogReducer, blogsReducer } from "./blogReducer";
...@@ -26,7 +33,7 @@ const reducers = combineReducers({ ...@@ -26,7 +33,7 @@ const reducers = combineReducers({
resetPassword: resetPasswordReducer, resetPassword: resetPasswordReducer,
similarProjects: similarProjectsReducer, similarProjects: similarProjectsReducer,
enquiry: enquiryReducer, enquiry: enquiryReducer,
displayEnquireNow:displayEnquireNowReducer, displayEnquireNow: displayEnquireNowReducer,
loggedInVendor: loggedInVendorReducer, loggedInVendor: loggedInVendorReducer,
updatedVendorData: updateVendorReducer, updatedVendorData: updateVendorReducer,
vendorDetails: getVendorDetailsReducer, vendorDetails: getVendorDetailsReducer,
...@@ -49,6 +56,7 @@ const reducers = combineReducers({ ...@@ -49,6 +56,7 @@ const reducers = combineReducers({
reviews: reviewsReducer, reviews: reviewsReducer,
giftCard: giftCardReducer, giftCard: giftCardReducer,
enquiriesByAdmin: getEnquiriesByVendorReducer, enquiriesByAdmin: getEnquiriesByVendorReducer,
enquiriesByEndUser: getEnquiriesByEndUserReducer,
}); });
export default reducers; export default reducers;
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!