Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
zango-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 19d7bae6
authored
2024-06-19 16:23:44 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
.
1 parent
8107e696
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
9 deletions
components/detail/DetailSchedule.js
components/signup/Signup.js
redux/actions/activityAction.js
components/detail/DetailSchedule.js
View file @
19d7bae
...
...
@@ -46,17 +46,17 @@ const DetailSchedule = ({ activityById }) => {
<
/span
>
From
:
{
activityById
.
data
.
attributes
.
fromDate
}
To
:
{
activityById
.
data
.
attributes
.
toDate
}
<
/li
>
<
li
>
{
/*
<li>
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/availability/time.svg" />
</span>
Time: {activityById.data.attributes.fromTime} - {activityById.data.attributes.toTime}
<
/li
>
</li>
*/
}
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/duration.svg"
/>
<
/span
>
Duration
:
{
activityById
.
data
.
attributes
.
minimumDuration
}
-
{
activityById
.
data
.
attributes
.
maximumDuration
}
Hour
s
Duration
:
{
activityById
.
data
.
attributes
.
minimumDuration
}
-
{
activityById
.
data
.
attributes
.
maximumDuration
}
Min
s
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
...
...
components/signup/Signup.js
View file @
19d7bae
...
...
@@ -15,7 +15,7 @@ import OTPInput from "../common-components/OTPInput";
import
{
finishVendorOtpVerification
}
from
"../../redux/actions/vendorActions"
;
import
{
signIn
}
from
"next-auth/react"
;
import
{
Loader
}
from
"react-bootstrap-typeahead"
;
import
qs
from
"qs"
;
const
Signup
=
props
=>
{
console
.
log
(
"props.type"
,
props
.
type
);
const
[
otp
,
setOtp
]
=
useState
(
new
Array
(
4
).
fill
(
""
));
...
...
@@ -23,7 +23,7 @@ const Signup = props => {
const
[
otpVerified
,
setOtpVerified
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
();
const
dispatch
=
useDispatch
();
const
router
=
useRouter
()
const
router
=
useRouter
()
;
const
otpValue
=
useRef
();
const
changeOtpRef
=
value
=>
{
console
.
log
(
otpValue
);
...
...
@@ -74,7 +74,6 @@ const Signup = props => {
}
};
return
(
<
Fragment
>
<
div
className
=
"contaier-fluid login-banner-image"
>
...
...
@@ -113,6 +112,35 @@ const Signup = props => {
{({
values
,
errors
,
touched
,
handleChange
,
handleBlur
,
handleSubmit
,
isValid
,
isSubmitting
})
=>
(
<
Form
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
)
{
setLoading
(
true
);
e
.
preventDefault
();
...
...
@@ -120,7 +148,7 @@ const Signup = props => {
let
user
;
if
(
props
.
type
==
"vendor"
)
{
user
=
await
dispatch
(
registerUser
({
...
values
,
role
:
"vendor"
}));
}
}
if
(
props
.
type
==
"user"
)
{
user
=
await
dispatch
(
registerUser
({
...
values
,
role
:
"endUser"
}));
}
...
...
@@ -134,8 +162,9 @@ const Signup = props => {
setLoading
(
false
);
}
else
{
e
.
preventDefault
();
setLoading
(
true
);
const
oneTimePassword
=
otp
.
join
(
""
);
setLoading
(
false
);
//
setLoading(false);
const
otpRes
=
await
finishVendorOtpVerification
({
email
:
values
.
email
,
oneTimePassword
});
console
.
log
(
"otpRes"
,
otpRes
);
if
(
otpRes
.
data
.
ok
)
{
...
...
@@ -148,7 +177,7 @@ const Signup = props => {
console
.
log
(
"result"
,
result
);
if
(
props
.
type
==
"vendor"
)
{
router
.
push
(
"/vendor/business-details"
);
}
}
if
(
props
.
type
==
"user"
)
{
router
.
push
(
"/signup/user/thankyou"
);
}
...
...
redux/actions/activityAction.js
View file @
19d7bae
...
...
@@ -112,6 +112,9 @@ export const getActivitiesByVendor = () => async dispatch => {
}
}
},
pagination
:
{
pageSize
:
-
1
,
},
populate
:
[
"masterMonths"
,
"subCategory"
,
...
...
@@ -270,6 +273,9 @@ export const getActivitiesForAdmin =
}
}
},
pagination
:
{
pageSize
:
-
1
,
},
populate
:
[
"masterMonths"
,
"subCategory"
,
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment