Commit 19d7bae6 by jaymehta

.

1 parent 8107e696
...@@ -46,17 +46,17 @@ const DetailSchedule = ({ activityById }) => { ...@@ -46,17 +46,17 @@ const DetailSchedule = ({ activityById }) => {
</span> </span>
From: {activityById.data.attributes.fromDate} To: {activityById.data.attributes.toDate} From: {activityById.data.attributes.fromDate} To: {activityById.data.attributes.toDate}
</li> </li>
<li> {/* <li>
<span className="image-container"> <span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/availability/time.svg" /> <Image layout="fill" alt="" className="image img-fluid" src="/images/availability/time.svg" />
</span> </span>
Time: {activityById.data.attributes.fromTime} - {activityById.data.attributes.toTime} Time: {activityById.data.attributes.fromTime} - {activityById.data.attributes.toTime}
</li> </li> */}
<li> <li>
<span className="image-container"> <span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/availability/duration.svg" /> <Image layout="fill" alt="" className="image img-fluid" src="/images/availability/duration.svg" />
</span> </span>
Duration: {activityById.data.attributes.minimumDuration}-{activityById.data.attributes.maximumDuration} Hours Duration: {activityById.data.attributes.minimumDuration}-{activityById.data.attributes.maximumDuration} Mins
</li> </li>
<li> <li>
<span className="image-container"> <span className="image-container">
......
...@@ -15,7 +15,7 @@ import OTPInput from "../common-components/OTPInput"; ...@@ -15,7 +15,7 @@ import OTPInput from "../common-components/OTPInput";
import { finishVendorOtpVerification } from "../../redux/actions/vendorActions"; import { finishVendorOtpVerification } from "../../redux/actions/vendorActions";
import { signIn } from "next-auth/react"; import { signIn } from "next-auth/react";
import { Loader } from "react-bootstrap-typeahead"; import { Loader } from "react-bootstrap-typeahead";
import qs from "qs";
const Signup = props => { const Signup = props => {
console.log("props.type", props.type); console.log("props.type", props.type);
const [otp, setOtp] = useState(new Array(4).fill("")); const [otp, setOtp] = useState(new Array(4).fill(""));
...@@ -23,7 +23,7 @@ const Signup = props => { ...@@ -23,7 +23,7 @@ const Signup = props => {
const [otpVerified, setOtpVerified] = useState(false); const [otpVerified, setOtpVerified] = useState(false);
const [loading, setLoading] = useState(); const [loading, setLoading] = useState();
const dispatch = useDispatch(); const dispatch = useDispatch();
const router = useRouter() const router = useRouter();
const otpValue = useRef(); const otpValue = useRef();
const changeOtpRef = value => { const changeOtpRef = value => {
console.log(otpValue); console.log(otpValue);
...@@ -74,7 +74,6 @@ const Signup = props => { ...@@ -74,7 +74,6 @@ const Signup = props => {
} }
}; };
return ( return (
<Fragment> <Fragment>
<div className="contaier-fluid login-banner-image"> <div className="contaier-fluid login-banner-image">
...@@ -113,6 +112,35 @@ const Signup = props => { ...@@ -113,6 +112,35 @@ const Signup = props => {
{({ values, errors, touched, handleChange, handleBlur, handleSubmit, isValid, isSubmitting }) => ( {({ values, errors, touched, handleChange, handleBlur, handleSubmit, isValid, isSubmitting }) => (
<Form <Form
onSubmit={async e => { onSubmit={async e => {
e.preventDefault();
const userConfig = {
headers: {
"Content-Type": "application/json"
}
};
const query = {
filters: {
$or: [{ email: { $eq: values.email } }, { phone: { $eq: values.mobile } }]
}
// populate: ["role"],
// fields: ["email", "role"]
};
const queryString = qs.stringify(query, {
encodeValuesOnly: true
});
const existingUser = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/users?${queryString}`, userConfig);
// if (existingUser) {
// console.log("existingUser", existingUser);
// if (existingUser.data && existingUser.data.length > 0) {
// if (existingUser.data[0].confirmed) {
// toast.warning("Email or phone number already registered, please use a different phone or email.");
// } else {
// toast.warning("Seems like you have already registered, please confirm the OTP")
// }
// }
// return;
// }
// return;
if (!isOtpSent) { if (!isOtpSent) {
setLoading(true); setLoading(true);
e.preventDefault(); e.preventDefault();
...@@ -134,8 +162,9 @@ const Signup = props => { ...@@ -134,8 +162,9 @@ const Signup = props => {
setLoading(false); setLoading(false);
} else { } else {
e.preventDefault(); e.preventDefault();
setLoading(true);
const oneTimePassword = otp.join(""); const oneTimePassword = otp.join("");
setLoading(false); // setLoading(false);
const otpRes = await finishVendorOtpVerification({ email: values.email, oneTimePassword }); const otpRes = await finishVendorOtpVerification({ email: values.email, oneTimePassword });
console.log("otpRes", otpRes); console.log("otpRes", otpRes);
if (otpRes.data.ok) { if (otpRes.data.ok) {
......
...@@ -112,6 +112,9 @@ export const getActivitiesByVendor = () => async dispatch => { ...@@ -112,6 +112,9 @@ export const getActivitiesByVendor = () => async dispatch => {
} }
} }
}, },
pagination: {
pageSize: -1,
},
populate: [ populate: [
"masterMonths", "masterMonths",
"subCategory", "subCategory",
...@@ -270,6 +273,9 @@ export const getActivitiesForAdmin = ...@@ -270,6 +273,9 @@ export const getActivitiesForAdmin =
} }
} }
}, },
pagination: {
pageSize: -1,
},
populate: [ populate: [
"masterMonths", "masterMonths",
"subCategory", "subCategory",
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!