Commit db7ced53 by jaymehta

.

1 parent 856042df
......@@ -44,7 +44,13 @@ const DetailSchedule = ({ activityById }) => {
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/availability/month.svg" />
</span>
{activityById.data.attributes.fromDate == "2021-01-01" ? (
"Available on all days"
) : (
<>
From: {activityById.data.attributes.fromDate} To: {activityById.data.attributes.toDate}
</>
)}
</li>
{/* <li>
<span className="image-container">
......
......@@ -56,45 +56,6 @@ const ActivityDetails = ({ isUpdate }) => {
const [cancellationPolicy, setCancellationPolicy] = useState();
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 }) => {
......
......@@ -400,8 +400,8 @@ export const getActivitiesByFilters =
maximumDuration,
activityType,
sort,
priceLowerLimit,
priceUpperLimit,
priceLowerLimit = 0,
priceUpperLimit = 5000,
currentPage
}) =>
async dispatch => {
......@@ -470,8 +470,11 @@ export const getActivitiesByFilters =
// { fromDate: {$lte: "2022-07-09"}}
if (fromDate && 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["$not"] = {
$or: [{ $and: [{ fromDate: { $lte: fromDate } }, { toDate: { $lte: fromDate } }] }, { $and: [{ fromDate: { $gte: toDate } }, { toDate: { $gte: toDate } }] }]
};
delete query.filters.fromDate;
delete query.filters.toDate;
}
......@@ -525,6 +528,14 @@ export const getActivitiesByFilters =
if (sort) {
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) {
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!