diff --git a/src/pages/authentication/RegisterPage.jsx b/src/pages/authentication/RegisterPage.jsx index 01368df0..656ccecf 100644 --- a/src/pages/authentication/RegisterPage.jsx +++ b/src/pages/authentication/RegisterPage.jsx @@ -7,7 +7,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; import showToast from "../../services/toastService"; import AuthRepository from "../../repositories/AuthRepository"; -import { MasterRespository } from "../../repositories/MastersRepository"; +import { MarketRespository } from "../../repositories/MarketRepository"; const mobileNumberRegex = /^(?:\d{10}|\d{3}[-\s]?\d{3}[-\s]?\d{4})$/; @@ -35,7 +35,7 @@ const registerSchema = z.object({ }); const RegisterPage = () => { - const [registered,setRegristered] = useState(false); + const [registered, setRegristered] = useState(false); const [industries, setIndustries] = useState([]); const { register, @@ -47,7 +47,7 @@ const RegisterPage = () => { const onSubmit = async (data) => { try { - const response = await AuthRepository.requestDemo(data); + const response = await MarketRespository.requestDemo(data); showToast("Your Registration SuccessFully !"); setRegristered(true); } catch (error) { @@ -59,12 +59,11 @@ const RegisterPage = () => { fetchIndustries(); }, []); - useEffect(() => { - }, [industries]); + useEffect(() => {}, [industries]); const fetchIndustries = async () => { try { - const response = await MasterRespository.getIndustries(); + const response = await MarketRespository.getIndustries(); const industry = response.data; setIndustries(industry); } catch (error) { @@ -73,254 +72,259 @@ const RegisterPage = () => { }; return ( <> - {!registered && ( -

Adventure starts here 🚀

-

Make your app management easy and fun!

+ {!registered && ( + +

Adventure starts here 🚀

+

Make your app management easy and fun!

-
-
- - - {errors.organizatioinName && ( -
- {errors.organizatioinName.message} -
- )} -
-
- - - {errors.email && ( -
- {errors.email.message} -
- )} -
-
- -
- -
- {errors.contactPerson && ( -
- {errors.contactPerson.message} -
- )} -
-
- -
- -
- {errors.contactNumber && ( -
- {errors.contactNumber.message} -
- )} -
-
- -
- -
- {errors.about && ( -
- {errors.about.message} -
- )} -
-
- -
- -
- {errors.oragnizationSize && ( -
- {errors.oragnizationSize.message} -
- )} -
-
- -
- + {errors.organizatioinName && ( +
+ {errors.organizatioinName.message} +
)} - -
- {errors.industryId && ( -
- {errors.industryId.message}
- )} -
-
-
- - -
- {errors.terms && ( -
- {errors.terms.message} +
+ + + {errors.email && ( +
+ {errors.email.message} +
+ )}
- )} -
- - +
+ +
+ +
+ {errors.contactPerson && ( +
+ {errors.contactPerson.message} +
+ )} +
+
+ +
+ +
+ {errors.contactNumber && ( +
+ {errors.contactNumber.message} +
+ )} +
+
+ +
+ +
+ {errors.about && ( +
+ {errors.about.message} +
+ )} +
+
+ +
+ +
+ {errors.oragnizationSize && ( +
+ {errors.oragnizationSize.message} +
+ )} +
+
+ +
+ +
+ {errors.industryId && ( +
+ {errors.industryId.message} +
+ )} +
+
+
+ + +
+ {errors.terms && ( +
+ {errors.terms.message} +
+ )} +
+ + -

- Already have an account? - - - Back to login - -

- )} - {registered && ( -
Thank you for contacting us
-

We will get back to you soon

- - - Back to login - -
)} +

+ Already have an account? + + + Back to login + +

+ + )} + {registered && ( + +
Thank you for contacting us
+

We will get back to you soon

+ + + Back to login + +
+ )} ); }; diff --git a/src/repositories/AuthRepository.jsx b/src/repositories/AuthRepository.jsx index b8a10e2d..231d8dea 100644 --- a/src/repositories/AuthRepository.jsx +++ b/src/repositories/AuthRepository.jsx @@ -2,15 +2,14 @@ import { api } from "../utils/axiosClient"; const AuthRepository = { login: (data) => api.post("/api/auth/login", data), - refreshToken: ( data ) => api.post( "/api/auth/refresh-token", data ), - - logout: ( data ) => api.post( "/api/auth/logout", data ), - profile: () => api.get( `/api/user/profile` ), - register: ( data ) => api.post( 'api/auth/register', data ), - resetPassword: ( data ) => api.post( '/api/auth/reset-password', data ), - forgotPassword: (data) => api.post( '/api/auth/forgot-password', data), - requestDemo: (data) => api.post('/api/auth/inquiry',data), - sendMail:(data)=>api.post("/api/auth/sendmail",data) + refreshToken: (data) => api.post("/api/auth/refresh-token", data), + + logout: (data) => api.post("/api/auth/logout", data), + profile: () => api.get(`/api/user/profile`), + register: (data) => api.post("api/auth/register", data), + resetPassword: (data) => api.post("/api/auth/reset-password", data), + forgotPassword: (data) => api.post("/api/auth/forgot-password", data), + sendMail: (data) => api.post("/api/auth/sendmail", data), }; export default AuthRepository; diff --git a/src/repositories/MarketRepository.jsx b/src/repositories/MarketRepository.jsx new file mode 100644 index 00000000..4baa3c74 --- /dev/null +++ b/src/repositories/MarketRepository.jsx @@ -0,0 +1,6 @@ +import { api } from "../utils/axiosClient"; + +export const MarketRepository = { + requestDemo: (data) => api.post("/api/market/inquiry", data), + getIndustries: () => api.get("api/market/industries"), +};