Commit cdf775d8 by jaymehta

.

1 parent 6c6a3b27
...@@ -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();
...@@ -184,7 +185,9 @@ const DetailInfo = ({ activityById }) => { ...@@ -184,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" }}>
...@@ -213,14 +216,16 @@ const DetailInfo = ({ activityById }) => { ...@@ -213,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>
...@@ -232,7 +237,9 @@ const DetailInfo = ({ activityById }) => { ...@@ -232,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>
......
...@@ -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,7 +45,9 @@ const Header = () => { ...@@ -45,7 +45,9 @@ 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]);
...@@ -284,7 +286,7 @@ const Header = () => { ...@@ -284,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">
......
import { Skeleton } from "antd";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link";
import React, { Fragment } from "react"; import React, { Fragment } from "react";
import { renderImage } from "../../services/imageHandling"; import { Button } from "react-bootstrap";
import { useSelector } from "react-redux";
import { cleanImage, renderImage } from "../../services/imageHandling";
import ActiveLink from "../common/ActiveLink";
const MyEnquires = () => { const MyEnquires = () => {
const bookingsData = [ const { enquiriesByEndUser, loading } = useSelector(state => state.enquiriesByEndUser);
{ console.log("enquiriesByEndUser", enquiriesByEndUser);
id: "0", const calculateRating = data => {
name: "City Climb", let value = 0;
start_date: "Jan 8, 2021", data.map(item => {
end_date: "Jan 9, 2021", // console.log("item", item);
price: "$200", value = value + item.attributes.rating;
status: "Confirmed", });
image: "/images/user/image1.png" // console.log("value", value);
}, let length = data.length;
{ return Math.floor(value / length);
id: "1", };
name: "City Climb",
start_date: "Jan 8, 2021",
end_date: "Jan 9, 2021",
price: "$200",
status: "Confirmed",
image: "/images/user/image1.png"
},
{
id: "2",
name: "City Climb",
start_date: "Jan 8, 2021",
end_date: "Jan 9, 2021",
price: "$200",
status: "Confirmed",
image: "/images/user/image1.png"
},
{
id: "3",
name: "City Climb",
start_date: "Jan 8, 2021",
end_date: "Jan 9, 2021",
price: "$200",
status: "Confirmed",
image: "/images/user/image1.png"
}
]
return ( return (
<Fragment> <Fragment>
<div className="container"> <div className="container">
<div className="row"> <div className="row">
<div className="col-12 col-lg-12 form-container content-wraaper"> <div className="col-12 col-lg-12 form-container content-wraaper">
<h2 className="px-2 px-lg-0">My Enquires</h2> <h2 className="px-2 px-lg-0">My Enquires</h2>
<div className="row"> {!loading ? (
{bookingsData?.length && bookingsData.map((data, index) => ( <div className="row">
<div className="col-12 col-sm-12 col-lg-3 col-md-6 px-4 px-lg-3" key={`1${index}`}> {enquiriesByEndUser?.length &&
<div className="card-booking"> enquiriesByEndUser.map((data, index) => (
<div className="card-booking-img"> <div className="col-12 col-sm-12 col-lg-3 col-md-6 px-4 px-lg-3" key={`1${index}`}>
<span className="image-container"> <div className="card-booking">
<Image src={renderImage(data.image)} layout="fill" className="image" /> <div className="browse-experiences-item">
</span> <div className="img-wrapper">
</div> <span className="image-container">
<div className="card-booking-content"> <img layout="fill" alt="" className="image img-fluid" src={cleanImage(data.attributes.experience?.data.attributes.image?.data?.attributes)} />
<p className="activity-name">{data.name}</p> </span>
<p>{data.start_date} - {data.end_date}</p> {data.attributes.experience?.data.attributes.rating > 100 && <div className="top-rated">Top Rated</div>}
<p>{data.price}</p> </div>
<p className="status">{data.status}</p> <div className="info">
</div> <div className="top-name">
<div className="hr-div" /> <div className="title">{data.attributes.experience?.data?.attributes?.name}</div>
<div className="card-booking-footer"> <div className="rating-wishlist">
<div className="d-flex align-items-center justify-content-between"> {data.attributes.experience?.data?.attributes?.reviews?.data.length > 0 && (
<div className="d-flex align-items-center"> <div className="rating">
<span className="image-container me-2"> {<span className="number">{calculateRating(data.attributes.experience?.data?.attributes?.reviews.data)}</span>}
<Image src={renderImage("/images/user/icon-rebook.svg")} layout="fill" className="image" /> <span className="image-container">
</span> <Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
<p className="duration mb-0">Rebook this booking</p> </span>
</div> </div>
<div className="image-container"> )}
<Image src={renderImage("/images/user/arrow-right.svg")} layout="fill" className="image" /> </div>
</div> </div>
</div> <div className="">
</div> <p>Enquired for date: {data.attributes.date}</p>
</div> </div>
</div> <div className="discription">
))} <span>
</div> {data.attributes.experience?.data?.attributes?.description.slice(0, 52)}...{" "}
<div className="row"> <Link href={`/activities/${data.attributes.experience?.data.id}`} prefetch>
{bookingsData?.length && bookingsData.map((data, index) => ( Read More
<div className="col-12 col-sm-12 col-lg-3 col-md-6 px-4 px-lg-3" key={`2${index}`}> </Link>
<div className="card-booking"> </span>
<div className="card-booking-img"> </div>
<span className="image-container"> <div className="price">${data.attributes.experience?.data?.attributes?.pricePerPerson}</div>
<Image src={renderImage(data.image)} layout="fill" className="image" /> <div className="detail">
</span> <div className="">Includes taxes & Fees</div>
</div> </div>
<div className="card-booking-content"> <div className="explore-now">
<p className="activity-name">{data.name}</p> <ActiveLink href={`/activities/${data.attributes.experience?.data.id}`} prefetch>
<p>{data.start_date} - {data.end_date}</p> <Button variant="primary">Explore Now</Button>
<p>{data.price}</p> </ActiveLink>
<p className="status">{data.status}</p> </div>
</div> </div>
<div className="hr-div" />
<div className="card-booking-footer">
<div className="d-flex align-items-center justify-content-between">
<div className="d-flex align-items-center">
<span className="image-container me-2">
<Image src={renderImage("/images/user/icon-rebook.svg")} layout="fill" className="image" />
</span>
<p className="duration mb-0">Rebook this booking</p>
</div>
<div className="image-container">
<Image src={renderImage("/images/user/arrow-right.svg")} layout="fill" className="image" />
</div>
</div>
</div>
</div>
</div>
))}
</div>
<div className="row">
{bookingsData?.length && bookingsData.map((data, index) => (
<div className="col-12 col-sm-12 col-lg-3 col-md-6 px-4 px-lg-3" key={`3${index}`}>
<div className="card-booking">
<div className="card-booking-img">
<span className="image-container">
<Image src={renderImage(data.image)} layout="fill" className="image" />
</span>
</div>
<div className="card-booking-content">
<p className="activity-name">{data.name}</p>
<p>{data.start_date} - {data.end_date}</p>
<p>{data.price}</p>
<p className="status">{data.status}</p>
</div>
<div className="hr-div" />
<div className="card-booking-footer">
<div className="d-flex align-items-center justify-content-between">
<div className="d-flex align-items-center">
<span className="image-container me-2">
<Image src={renderImage("/images/user/icon-rebook.svg")} layout="fill" className="image" />
</span>
<p className="duration mb-0">Rebook this booking</p>
</div>
<div className="image-container">
<Image src={renderImage("/images/user/arrow-right.svg")} layout="fill" className="image" />
</div>
</div>
</div>
</div>
</div>
))}
</div> </div>
</div>
</div> </div>
))}
</div>
) : (
<div className="container">
<div className="py-5">
<div className="row">
{[1, 2, 3].map(() => (
<div className="col-lg-3 col-md-4 col-sm-12">
<div className="d-inline-flex flex-column">
<Skeleton.Button active style={{ height: 250, width: 290 }} />
<Skeleton.Button active style={{ marginTop: 10, width: 120 }} />
</div>
</div>
))}
</div>
</div> </div>
</div> </div>
</Fragment> )}
) </div>
} </div>
</div>
</Fragment>
);
};
export default MyEnquires;
\ No newline at end of file \ No newline at end of file
export default MyEnquires;
...@@ -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!