Commit db7ced53 by jaymehta

.

1 parent 856042df
...@@ -44,7 +44,13 @@ const DetailSchedule = ({ activityById }) => { ...@@ -44,7 +44,13 @@ const DetailSchedule = ({ activityById }) => {
<span className="image-container"> <span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/availability/month.svg" /> <Image layout="fill" alt="" className="image img-fluid" src="/images/availability/month.svg" />
</span> </span>
From: {activityById.data.attributes.fromDate} To: {activityById.data.attributes.toDate} {activityById.data.attributes.fromDate == "2021-01-01" ? (
"Available on all days"
) : (
<>
From: {activityById.data.attributes.fromDate} To: {activityById.data.attributes.toDate}
</>
)}
</li> </li>
{/* <li> {/* <li>
<span className="image-container"> <span className="image-container">
......
...@@ -56,45 +56,6 @@ const ActivityDetails = ({ isUpdate }) => { ...@@ -56,45 +56,6 @@ const ActivityDetails = ({ isUpdate }) => {
const [cancellationPolicy, setCancellationPolicy] = useState(); const [cancellationPolicy, setCancellationPolicy] = useState();
useEffect(() => { useEffect(() => {
// dispatch(loadUser());
// setFileList([
// // {
// // uid: "-1",
// // name: "image.png",
// // status: "done",
// // url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
// // },
// // {
// // uid: "-2",
// // name: "image.png",
// // status: "done",
// // url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
// // },
// // {
// // uid: "-3",
// // name: "image.png",
// // status: "done",
// // url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
// // },
// // {
// // uid: "-4",
// // name: "image.png",
// // status: "done",
// // url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
// // },
// // {
// // uid: "-xxx",
// // percent: 50,
// // name: "image.png",
// // status: "uploading",
// // url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
// // },
// // {
// // uid: "-5",
// // name: "image.png",
// // status: "error"
// // }
// ]);
}, []); }, []);
const ActivityApprovalStatus = ({ status }) => { const ActivityApprovalStatus = ({ status }) => {
......
...@@ -400,8 +400,8 @@ export const getActivitiesByFilters = ...@@ -400,8 +400,8 @@ export const getActivitiesByFilters =
maximumDuration, maximumDuration,
activityType, activityType,
sort, sort,
priceLowerLimit, priceLowerLimit = 0,
priceUpperLimit, priceUpperLimit = 5000,
currentPage currentPage
}) => }) =>
async dispatch => { async dispatch => {
...@@ -470,8 +470,11 @@ export const getActivitiesByFilters = ...@@ -470,8 +470,11 @@ export const getActivitiesByFilters =
// { fromDate: {$lte: "2022-07-09"}} // { fromDate: {$lte: "2022-07-09"}}
if (fromDate && toDate) { if (fromDate && toDate) {
// query.filters["$and"] = [{ fromDate: { $gte: fromDate } }, { toDate: { $lte: toDate } }]; // query.filters["$and"] = [{ fromDate: { $gte: fromDate } }, { toDate: { $lte: toDate } }];
query.filters["$or"] = [{ fromDate: { $eq: "2021-01-01" } }, { $and: [{ fromDate: { $gte: fromDate } }, { toDate: { $lte: toDate } }] }]; // query.filters["$or"] = [{ fromDate: { $eq: "2021-01-01" } }, { $and: [{ fromDate: { $gte: fromDate } }, { toDate: { $lte: toDate } }] }];
// query.filters["$or"] = [{ fromDate: { $gte: fromDate } }, { toDate: { $lte: toDate } }]; // query.filters["$or"] = [{ fromDate: { $gte: fromDate } }, { toDate: { $lte: toDate } }];
query.filters["$not"] = {
$or: [{ $and: [{ fromDate: { $lte: fromDate } }, { toDate: { $lte: fromDate } }] }, { $and: [{ fromDate: { $gte: toDate } }, { toDate: { $gte: toDate } }] }]
};
delete query.filters.fromDate; delete query.filters.fromDate;
delete query.filters.toDate; delete query.filters.toDate;
} }
...@@ -525,6 +528,14 @@ export const getActivitiesByFilters = ...@@ -525,6 +528,14 @@ export const getActivitiesByFilters =
if (sort) { if (sort) {
query["sort"] = sortFilter; query["sort"] = sortFilter;
} }
if (priceUpperLimit && priceLowerLimit) {
// query.filters[]
if (query.filters.$and) {
query.filters.$and = [...query.filters.$and, { pricePerPerson: { $lte: priceUpperLimit } }, { pricePerPerson: { $gte: priceLowerLimit } }];
} else {
query.filters["$and"] = [{ pricePerPerson: { $lte: priceUpperLimit } }, { pricePerPerson: { $gte: priceLowerLimit } }];
}
}
if (priceUpperLimit) { if (priceUpperLimit) {
query.filters["pricePerPerson"] = { $lte: priceUpperLimit }; query.filters["pricePerPerson"] = { $lte: priceUpperLimit };
} }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!