Commit a216359b by jaymehta

.

1 parent 2b663a1a
...@@ -84,12 +84,13 @@ const VendorListing = () => { ...@@ -84,12 +84,13 @@ const VendorListing = () => {
let initialData = let initialData =
allVendors && allVendors &&
allVendors.map(item => { allVendors.map(item => {
console.log("item", item.attributes.user.data);
return { return {
key: item.id, key: item.id,
name: item.attributes.name, name: item.attributes.name,
businessName: item.attributes.businessName, businessName: item.attributes.businessName,
status: [item.attributes.user.data.attributes.approved], status: [item.attributes.user.data?.attributes.approved],
confirmed: item.attributes.user.data.attributes.confirmed confirmed: item.attributes.user.data?.attributes.confirmed
}; };
}); });
console.log("initialData", initialData); console.log("initialData", initialData);
...@@ -153,7 +154,7 @@ const VendorListing = () => { ...@@ -153,7 +154,7 @@ const VendorListing = () => {
// console.log("color", color); // console.log("color", color);
return ( return (
<Tag color={color} key={tag}> <Tag color={color} key={tag}>
{tag.toString().toUpperCase()} {tag?.toString().toUpperCase()}
</Tag> </Tag>
); );
})} })}
......
...@@ -83,6 +83,9 @@ const ListingInner = ({ allActivitiesData, loading }) => { ...@@ -83,6 +83,9 @@ const ListingInner = ({ allActivitiesData, loading }) => {
if (activityFilters.sorting) { if (activityFilters.sorting) {
filters["sort"] = activityFilters.sorting; filters["sort"] = activityFilters.sorting;
} }
if (activityFilters.priceUpperLimit) {
filters["priceUpperLimit"] = activityFilters.priceUpperLimit;
}
// console.log("subcategory >>", filters); // console.log("subcategory >>", filters);
dispatch( dispatch(
getActivitiesByFilters({ getActivitiesByFilters({
...@@ -96,7 +99,8 @@ const ListingInner = ({ allActivitiesData, loading }) => { ...@@ -96,7 +99,8 @@ const ListingInner = ({ allActivitiesData, loading }) => {
minGroupSize: filters.minGroupSize, minGroupSize: filters.minGroupSize,
maxGroupSize: filters.maxGroupSize, maxGroupSize: filters.maxGroupSize,
ageLowerLimit: filters.ageLowerLimit, ageLowerLimit: filters.ageLowerLimit,
sort: filters.sort sort: filters.sort,
priceUpperLimit: filters.priceUpperLimit
}) })
); );
}, [activityFilters]); }, [activityFilters]);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"@ant-design/icons": "^5.3.6", "@ant-design/icons": "^5.3.6",
"@stripe/stripe-js": "^1.35.0", "@stripe/stripe-js": "^1.35.0",
"antd": "^5.15.3", "antd": "^5.15.3",
"antd-img-crop": "^4.22.0",
"axios": "^0.27.2", "axios": "^0.27.2",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"easyinvoice": "^2.3.3", "easyinvoice": "^2.3.3",
......
...@@ -151,7 +151,7 @@ export const getActivityById = id => async dispatch => { ...@@ -151,7 +151,7 @@ export const getActivityById = id => async dispatch => {
}; };
const query = { const query = {
populate: ["masterMonths", "subCategory", "subCategory.category", "timeSlots", "masterPincode", "vendor", "category"] populate: ["masterMonths", "subCategory", "subCategory.category", "timeSlots", "masterPincode", "vendor", "category", "imagesComponent"]
}; };
const queryString = qs.stringify(query, { const queryString = qs.stringify(query, {
encodeValuesOnly: true encodeValuesOnly: true
...@@ -319,7 +319,23 @@ export const getActivitiesForEndUser = () => async dispatch => { ...@@ -319,7 +319,23 @@ export const getActivitiesForEndUser = () => async dispatch => {
}; };
export const getActivitiesByFilters = export const getActivitiesByFilters =
({ category, subCategory, price, ageLowerLimit, duration, fromDate, toDate, minGroupSize, maxGroupSize, minimumDuration, maximumDuration, activityType, sort, priceLowerLimit, priceUpperLimit }) => ({
category,
subCategory,
price,
ageLowerLimit,
duration,
fromDate,
toDate,
minGroupSize,
maxGroupSize,
minimumDuration,
maximumDuration,
activityType,
sort,
priceLowerLimit,
priceUpperLimit
}) =>
async dispatch => { async dispatch => {
let sortFilter = []; let sortFilter = [];
try { try {
...@@ -391,8 +407,8 @@ export const getActivitiesByFilters = ...@@ -391,8 +407,8 @@ export const getActivitiesByFilters =
if (sort) { if (sort) {
query["sort"] = sortFilter; query["sort"] = sortFilter;
} }
if (priceLowerLimit && priceUpperLimit) { if (priceUpperLimit) {
query.filters["pricePerPerson"] = { $lte: priceUpperLimit };
} }
// console.log("subcategoryquery:", query); // console.log("subcategoryquery:", query);
......
...@@ -44,6 +44,7 @@ export const registerUser = userData => async dispatch => { ...@@ -44,6 +44,7 @@ export const registerUser = userData => async dispatch => {
userFormData.append("password", userData.password); userFormData.append("password", userData.password);
userFormData.append("role", userData.role); userFormData.append("role", userData.role);
userFormData.append("phone", userData.mobile); userFormData.append("phone", userData.mobile);
userFormData.append("approved", "pending");
console.log("userFormData", userFormData); console.log("userFormData", userFormData);
const response = await axios.post(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/auth/local/register`, userFormData, config); const response = await axios.post(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/auth/local/register`, userFormData, config);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!