-
-
- {peerTaskCount}
-
-
- tasks pending for
-
- peer-approval
-
-
-
-
-
- {appraiserTaskCount}
-
-
- tasks pending for
-
- appraisal-approval
-
-
-
+ {!countLoading && <>
+ {currentTab === "tasks" &&
+
+
+ {peerTaskCount}
+ tasks pending for
peer-approval
+
+
+ {appraiserTaskCount}
+ tasks pending for
appraisal-approval
- )}
- >
- )}
- {currentTab === "leaderboard" ? (
+
+ }
+ >}
+ {currentTab === "leaderboard" ?
- ) : (
+ :
- )}
+ }
>
- );
-};
+ )
+}
+
export default DiscordModeration;
diff --git a/src/modules/Dashboard/modules/DiscordModeration/services/apis.ts b/src/modules/Dashboard/modules/DiscordModeration/services/apis.ts
index 62f12ef77..5282ae0ef 100644
--- a/src/modules/Dashboard/modules/DiscordModeration/services/apis.ts
+++ b/src/modules/Dashboard/modules/DiscordModeration/services/apis.ts
@@ -4,17 +4,44 @@ import { AxiosError } from "axios";
export const getTaskList = async (
setTaskData: UseStateFunc
,
- setIsLoading: UseStateFunc
+ pageTD: number,
+ selectedValue: number,
+ setTotalPagesTD?: UseStateFunc,
+ sortID?: string,
+ setIsLoading?: UseStateFunc,
) => {
- setIsLoading(true);
- try {
- const response = await privateGateway.get(dashboardRoutes.taskList);
- const taskList: any = response?.data.response;
- setTaskData(taskList);
- setIsLoading(false);
- } catch (err: unknown) {
- const error = err as AxiosError;
- }
+ console.log(sortID);
+
+ setIsLoading && setIsLoading(true);
+ privateGateway
+ .get(dashboardRoutes.taskList, {
+ params: {
+ perPage: selectedValue,
+ pageIndex: pageTD,
+ sortBy: sortID
+ }
+ })
+ .then(
+ (
+ response: APIResponse<{
+ data: any[];
+ pagination: { totalPages: number };
+ }>
+ ) => {
+ console.log(response.data);
+
+ const updatedTaskData= response.data.response.data
+ setTaskData(updatedTaskData);
+ if (setTotalPagesTD)
+ setTotalPagesTD(response.data.response.pagination.totalPages);
+ }
+ )
+ .catch(error => {
+ console.log(error);
+ })
+ .finally(() => {
+ setIsLoading && setIsLoading(false);
+ });
};
export const getTaskCount = async (
@@ -24,12 +51,10 @@ export const getTaskCount = async (
) => {
setCountLoading(true);
try {
- const response = await privateGateway.get(
- dashboardRoutes.taskListCount
- );
+ const response = await privateGateway.get(dashboardRoutes.taskListCount);
const taskData: any = response?.data.response;
- setpeerTaskCount(taskData.peer_pending);
- setappraiserTaskCount(taskData.peer_pending);
+ setpeerTaskCount(taskData.peer_pending)
+ setappraiserTaskCount(taskData.peer_pending)
setCountLoading(false);
} catch (err: unknown) {
const error = err as AxiosError;
@@ -38,23 +63,40 @@ export const getTaskCount = async (
export const getLeaderBoard = async (
setLeaderBoardData: UseStateFunc,
- setIsLoading: UseStateFunc,
- moderatorType: String | null
+ pageLD: number,
+ selectedValue: number,
+ moderatorType:String | null,
+ setTotalPagesLD?: UseStateFunc,
+ sortID?: string,
+ setIsLoading?: UseStateFunc,
) => {
- setIsLoading(true);
- try {
- console.log("api called", moderatorType);
- const response = await privateGateway.get(dashboardRoutes.leaderboard, {
- params: {
- option: moderatorType
- }
- });
- const leaderboardList: any = response?.data.response;
- console.log(leaderboardList);
- setLeaderBoardData(leaderboardList);
- setIsLoading(false);
- } catch (err: unknown) {
- const error = err as AxiosError;
- console.log(err);
- }
+ setIsLoading && setIsLoading(true);
+ privateGateway
+ .get(dashboardRoutes.leaderboard, {
+ params: {
+ perPage: selectedValue,
+ pageIndex: pageLD,
+ sortBy: sortID,
+ option:moderatorType
+ }
+ })
+ .then(
+ (
+ response: APIResponse<{
+ data: any[];
+ pagination: { totalPages: number };
+ }>
+ ) => {
+ const updatedLeaderBoardData= response.data.response.data
+ setLeaderBoardData(updatedLeaderBoardData);
+ if (setTotalPagesLD)
+ setTotalPagesLD(response.data.response.pagination.totalPages);
+ }
+ )
+ .catch(error => {
+ console.log(error);
+ })
+ .finally(() => {
+ setIsLoading && setIsLoading(false);
+ });
};
diff --git a/src/modules/Dashboard/modules/ProfileV2/components/ProfileHeader/ProfileHeader.tsx b/src/modules/Dashboard/modules/ProfileV2/components/ProfileHeader/ProfileHeader.tsx
index 6d67ea7ba..188b43821 100644
--- a/src/modules/Dashboard/modules/ProfileV2/components/ProfileHeader/ProfileHeader.tsx
+++ b/src/modules/Dashboard/modules/ProfileV2/components/ProfileHeader/ProfileHeader.tsx
@@ -13,150 +13,143 @@ import Dribble from "../../assets/svg/Dribble";
import StackOverflow from "../../assets/svg/StackOverflow";
import Medium from "../../assets/svg/Medium";
interface ProfileHeaderProps {
- userProfile: {
- first_name: string;
- last_name: string;
- college_code: string;
- muid: string;
- level: string;
- profile_pic: string;
- karma: string;
- rank: string;
- };
- socials: { key: string; value: string }[];
- monthDifference: number;
+ userProfile: {
+ first_name: string;
+ last_name: string;
+ college_code: string;
+ muid: string;
+ level: string;
+ profile_pic: string;
+ karma: string;
+ rank: string;
+ };
+ socials: { key: string; value: string }[];
+ monthDifference: number;
}
const socialMediaUrlMappings: { [key: string]: string } = {
- github: "https://github.com/",
- facebook: "https://www.facebook.com/",
- instagram: "https://www.instagram.com/",
- linkedin: "https://www.linkedin.com/in/",
- dribble: "https://dribbble.com/",
- behance: "https://www.behance.net/",
- stackoverflow: "https://stackoverflow.com/users/",
- medium: "https://medium.com/@"
+ github: "https://github.com/",
+ facebook: "https://www.facebook.com/",
+ instagram: "https://www.instagram.com/",
+ linkedin: "https://www.linkedin.com/in/",
+ dribble: "https://dribbble.com/",
+ behance: "https://www.behance.net/",
+ stackoverflow: "https://stackoverflow.com/users/",
+ medium: "https://medium.com/@",
};
const socialMediaSvgComponents: { [key: string]: JSX.Element | null } = {
- github: ,
- linkedin: ,
- twitter: ,
- instagram: ,
- behance: ,
- facebook: ,
- dribble: ,
- stackoverflow: ,
- medium:
+ github: ,
+ linkedin: ,
+ twitter: ,
+ instagram: ,
+ behance: ,
+ facebook: ,
+ dribble: ,
+ stackoverflow: ,
+ medium: ,
};
const ProfileHeader = ({
- userProfile,
- socials,
- monthDifference
+ userProfile,
+ socials,
+ monthDifference,
}: ProfileHeaderProps) => {
- return (
-
-
-
-
-
- {userProfile.first_name} {userProfile.last_name}{" "}
- {userProfile.college_code
- ? `(${userProfile.college_code})`
- : null}
-
-
{userProfile.muid}
-
-
-
-
Level
-
- {userProfile.level
- ? userProfile?.level?.slice(3, 4)
- : 1}
-
-
-
+ return (
+
+
+
+
+
+ {userProfile.first_name} {userProfile.last_name}{" "}
+ {userProfile.college_code ? `(${userProfile.college_code})` : null}
+
+
{
+ navigator.clipboard.writeText(`${userProfile.muid}`);
+ }}
+ >
+ {userProfile.muid}
+
+
+
+
+
Level
+
{userProfile.level ? userProfile?.level?.slice(3, 4) : 1}
+
+
-
-
-
-
-
Level
-
- {userProfile.level
- ? userProfile?.level?.slice(3, 4)
- : 1}
-
-
-
-
-
-
-
Karma
-
- {parseInt(userProfile.karma) > 1000
- ? (
- parseInt(userProfile.karma) / 1000
- ).toPrecision(3) + "K"
- : userProfile.karma}
-
-
-
-
-
-
-
Rank
-
{userProfile.rank}
-
-
-
-
-
-
Avg.Karma
-
- {parseInt(userProfile.karma) / monthDifference >
- 1000 && monthDifference !== 0
- ? (
- parseInt(userProfile.karma) /
- monthDifference /
- 1000
- ).toPrecision(4) + "K"
- : isNaN(
- parseInt(userProfile.karma) /
- monthDifference
- )
- ? "0"
- : monthDifference === 0
- ? "0"
- : (
- parseInt(userProfile.karma) /
- monthDifference
- ).toPrecision(3)}
-
-
-
-
+
+
+
+
+
Level
+
+ {userProfile.level ? userProfile?.level?.slice(3, 4) : 1}
+
+
+
+
+
+
+
Karma
+
+ {parseInt(userProfile.karma) > 1000
+ ? (parseInt(userProfile.karma) / 1000).toPrecision(3) + "K"
+ : userProfile.karma}
+
+
+
+
+
+
Rank
+
{userProfile.rank}
+
+
+
+
+
+
Avg.Karma
+
+ {parseInt(userProfile.karma) / monthDifference > 1000 &&
+ monthDifference !== 0
+ ? (
+ parseInt(userProfile.karma) /
+ monthDifference /
+ 1000
+ ).toPrecision(4) + "K"
+ : isNaN(parseInt(userProfile.karma) / monthDifference)
+ ? "0"
+ : monthDifference === 0
+ ? "0"
+ : (parseInt(userProfile.karma) / monthDifference).toPrecision(
+ 3
+ )}
+
+
+
- );
+
+
+ );
};
export default ProfileHeader;
+
diff --git a/src/modules/Dashboard/modules/Wadhwani/index.module.css b/src/modules/Dashboard/modules/Wadhwani/index.module.css
new file mode 100644
index 000000000..bcc7b7a09
--- /dev/null
+++ b/src/modules/Dashboard/modules/Wadhwani/index.module.css
@@ -0,0 +1,47 @@
+.wrapper h1 {
+ font-weight: bold;
+ font-size: 3rem;
+}
+
+.container {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ width: 100%;
+}
+
+.card {
+ width: 20vw;
+ margin: 1rem;
+ padding: 1rem;
+ border: 1px solid var(--Primary);
+ border-radius: 5px;
+ background-color: var(--White);
+ color: black;
+ cursor: pointer;
+}
+
+.card:hover {
+ background-color: aliceblue;
+}
+
+@media screen and (max-width: 1300px) {
+ .card {
+ width: 30vw;
+ }
+}
+
+@media screen and (max-width: 700px) {
+ .wrapper h1 {
+ font-size: 2rem;
+ }
+ .card {
+ width: 70vw;
+ }
+}
+
+@media screen and (max-width: 500px) {
+ .card {
+ width: 85vw;
+ }
+}
\ No newline at end of file
diff --git a/src/modules/Dashboard/modules/Wadhwani/index.tsx b/src/modules/Dashboard/modules/Wadhwani/index.tsx
new file mode 100644
index 000000000..4a4784d63
--- /dev/null
+++ b/src/modules/Dashboard/modules/Wadhwani/index.tsx
@@ -0,0 +1,65 @@
+import { useEffect, useState } from "react";
+import {
+ getWadhwaniClientToken,
+ getWadhwaniCourseLink,
+ getWadhwaniCourses
+} from "./services/api";
+import toast from "react-hot-toast";
+import styles from "./index.module.css";
+
+const Wadhwani = () => {
+ const [data, setData] = useState
([]);
+ const [clientToken, setClientToken] = useState("");
+
+ useEffect(() => {
+ fetchData();
+ }, []);
+
+ const fetchData = async () => {
+ const { response, error } = await getWadhwaniClientToken();
+ if (error) {
+ toast.error(error);
+ } else if (response) {
+ setClientToken(response.access_token);
+ const { response: courses, error } = await getWadhwaniCourses(
+ response.access_token
+ );
+ if (error) {
+ toast.error(error);
+ } else if (courses) {
+ setData(courses);
+ }
+ }
+ };
+
+ const handleCourseSelection = async (course: wadhwaniCourseResponse) => {
+ const { response, error } = await getWadhwaniCourseLink(
+ clientToken,
+ course.courseRootId
+ );
+ if (error) {
+ toast.error(error);
+ } else if (response) {
+ window.open(response.data, "_blank", "noopener,noreferrer");
+ }
+ };
+
+ return (
+
+
Wadhwani Foundation Courses
+
+ {data.map(course => (
+
handleCourseSelection(course)}
+ >
+
{course.courseName}
+
+ ))}
+
+
+ );
+};
+
+export default Wadhwani;
diff --git a/src/modules/Dashboard/modules/Wadhwani/services/api.ts b/src/modules/Dashboard/modules/Wadhwani/services/api.ts
new file mode 100644
index 000000000..55c7d4159
--- /dev/null
+++ b/src/modules/Dashboard/modules/Wadhwani/services/api.ts
@@ -0,0 +1,99 @@
+import { privateGateway } from "@/MuLearnServices/apiGateways";
+import { dashboardRoutes } from "@/MuLearnServices/urls";
+import { AxiosError } from "axios";
+
+export const getWadhwaniClientToken = async () => {
+ try {
+ const response = await privateGateway.post(
+ dashboardRoutes.getWadhwaniClientToken
+ );
+ const message: WadhwaniTokenResponse = response?.data?.response;
+ return { response: message, error: null };
+ } catch (err: unknown) {
+ const error = err as AxiosError;
+ if (error?.response) {
+ throw error;
+ } else {
+ return { response: null, error: error.message };
+ }
+ }
+};
+
+export const getWadhwaniCourses = async (clientToken: string) => {
+ try {
+ const response = await privateGateway.post(
+ dashboardRoutes.getWadhwaniCourses,
+ {
+ "Client-Auth-Token": clientToken
+ },
+ {
+ maxBodyLength: Infinity
+ }
+ );
+ const message: wadhwaniCourseResponse[] =
+ response?.data?.response?.data;
+ return { response: message, error: null };
+ } catch (err: unknown) {
+ const error = err as AxiosError;
+ if (error?.response) {
+ throw error;
+ } else {
+ return { response: null, error: error.message };
+ }
+ }
+};
+
+export const getWadhwaniCourseLink = async (
+ clientToken: string,
+ courseId: string
+) => {
+ try {
+ const response = await privateGateway.post(
+ dashboardRoutes.getWadhwaniCourseLink,
+ {
+ "Client-Auth-Token": clientToken,
+ course_root_id: courseId
+ },
+ {
+ maxBodyLength: Infinity
+ }
+ );
+ const message: wadhwaniCourseRedirectResponse = response?.data?.response;
+ if (message.data?.error?.code) {
+ return { response: null, error: message.data.error.description };
+ }
+ return { response: message, error: null };
+ } catch (err: unknown) {
+ const error = err as AxiosError;
+ if (error?.response) {
+ throw error;
+ } else {
+ return { response: null, error: error.message };
+ }
+ }
+};
+
+// const axios = require('axios');
+// const FormData = require('form-data');
+// let data = new FormData();
+// data.append('course_root_id', '64931a5571b86329790efb76');
+// data.append('Client-Auth-Token', 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJyekdBUjZCX0dpU21zRFJZT2syczZXOE0xSnlUckpPUGd0bFQwVGZSVGswIn0.eyJleHAiOjE3MTQyMTg4MjMsImlhdCI6MTcxNDIxODIyMywianRpIjoiYjkxZDU0OWYtYzg2ZC00ZDBhLTljZjEtYmNmODBmZTgzZDZhIiwiaXNzIjoiaHR0cHM6Ly93b2Rldi5pYW0ud2ZnbG9iYWwub3JnL2F1dGgvcmVhbG1zL3dmLW9wcG9ydHVuaXR5IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImJkMDhiNWM4LWMxNjUtNDQzNi05NjVmLWEwY2U3ODYxNTkyMiIsInR5cCI6IkJlYXJlciIsImF6cCI6Im11bGVhcm4iLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbImRlZmF1bHQtcm9sZXMtd2Ytb3Bwb3J0dW5pdHkiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6Im11bGVhcm4iLCJjbGllbnRIb3N0IjoiNDMuMjA1LjEwNi4xMzkiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtbXVsZWFybiIsImNsaWVudEFkZHJlc3MiOiI0My4yMDUuMTA2LjEzOSJ9.jOE2n-5Ig2IlxU2wONqd7E202mvOvH_Ifhv9Iz_A80JKzMx29um2_kj6e0tadC-UDWBKi6oxkekPXKKpJNrl0JRXZysSoWQHK47zCaKDo9oP6MGEewQgpSAzf1NGWsPiOQN36MGoijR-VE9p5CWfDmgSHiUKxlMx3t2ORYg15bfkSeOmt6vVb4pdJsJQfaCmQH5xDV5dVRRisGYqnv7QRTRzLKkLbd-MIc8YSAsAXWMv5msIiiFEsjIyU2R-OKSinCxThP6RszkHz0Ek_HI5DXJEDfxIRjDiqKRmIJnP0c6f_8tqq5UA9Y_Dbgt-ffkGBBvkNWTkxeDhnDbdwj23NQ');
+
+// let config = {
+// method: 'post',
+// maxBodyLength: Infinity,
+// url: 'https://dev.mulearn.org/api/v1/integrations/wadhwani/user-login/',
+// headers: {
+// 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjdlZDlmNjFlLTY3YzUtNDBiMy1iYTkyLWRmN2Q4NzEyNzA5MCIsIm11aWQiOiJhZG5hbmthdHRla2FkZW5AbXVsZWFybiIsInJvbGVzIjpbIlpvbmFsIENhbXB1cyBMZWFkIiwiRGlzdHJpY3QgQ2FtcHVzIExlYWQiLCJTdHVkZW50IiwiQWRtaW5zIiwiQWRtaW5zIiwiQ2FtcHVzIExlYWQiXSwiZXhwaXJ5IjoiMjAyNC0wNC0yNyAxNDo0MzowMCswMDowMCIsInRva2VuVHlwZSI6ImFjY2VzcyJ9.85KZ1PIldLS2awJi66CHCd754pUrcwbwomZw6xORe7w',
+// ...data.getHeaders()
+// },
+// data : data
+// };
+
+// axios.request(config)
+// .then((response) => {
+// console.log(JSON.stringify(response.data));
+// })
+// .catch((error) => {
+// console.log(error);
+// });
diff --git a/src/modules/Dashboard/modules/Wadhwani/services/types.d.ts b/src/modules/Dashboard/modules/Wadhwani/services/types.d.ts
new file mode 100644
index 000000000..19a9621a3
--- /dev/null
+++ b/src/modules/Dashboard/modules/Wadhwani/services/types.d.ts
@@ -0,0 +1,25 @@
+interface WadhwaniTokenResponse {
+ access_token: string;
+ expires_in: number;
+ refresh_expires_in: number;
+ token_type: string;
+ "not-before-policy": number;
+ scope: string;
+}
+
+interface wadhwaniCourseResponse {
+ courseId: string;
+ courseName: string;
+ servingMode: string[];
+ courseRootId: string;
+ description: string;
+ version: string;
+ thumbnail: string;
+ language: string;
+ enrollStatus: boolean;
+}
+
+interface wadhwaniCourseRedirectResponse {
+ status: string;
+ data: any;
+}
\ No newline at end of file
diff --git a/src/modules/Public/Donation/Donation.module.css b/src/modules/Public/Donation/Donation.module.css
new file mode 100644
index 000000000..a1a21f775
--- /dev/null
+++ b/src/modules/Public/Donation/Donation.module.css
@@ -0,0 +1,16 @@
+.fieldsContainer{
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ margin-bottom: 10px;
+}
+
+.inputStyles{
+ padding: 10px;
+ border-radius: 4px;
+ outline: none;
+ background-color: #f3f3f4;
+ font-size: 14px;
+ width: 100%;
+ box-sizing: border-box;
+}
\ No newline at end of file
diff --git a/src/modules/Public/Donation/Donation.tsx b/src/modules/Public/Donation/Donation.tsx
new file mode 100644
index 000000000..3c0ad76e6
--- /dev/null
+++ b/src/modules/Public/Donation/Donation.tsx
@@ -0,0 +1,90 @@
+import React, { useState, useRef } from "react";
+import MuModal from "@/MuLearnComponents/MuModal/MuModal";
+import { submitForm } from "./services/api";
+import styles from "./Donation.module.css";
+import toast from "react-hot-toast";
+const Donation = () => {
+ const [amount, setAmount] = useState();
+ const [name, setName] = useState("");
+ const [email, setEmail] = useState("");
+ const [mobile, setMobile] = useState();
+ const [pan, setPan] = useState("");
+
+ const callRazorpay = () => {
+ if (!amount || !name || !email || !mobile || !pan) {
+ toast.error("Please fill all the fields");
+ return;
+ }
+
+ submitForm({
+ amount: amount,
+ name: name,
+ email: email,
+ mobile: mobile,
+ pan: pan
+ });
+ };
+
+ return (
+ <>
+ console.log("closed")}
+ title="Donation"
+ type="success"
+ onDone={() => callRazorpay()}
+ >
+
+ setAmount(Number(e.target.value))}
+ required
+ />
+
+
+ setName(e.target.value)}
+ required
+ />
+
+
+ setEmail(e.target.value)}
+ required
+ />
+
+
+ setMobile(Number(e.target.value))}
+ required
+ />
+
+ setPan(e.target.value)}
+ required
+ />
+
+ >
+ );
+};
+
+export default Donation;
diff --git a/src/modules/Public/Donation/services/api.ts b/src/modules/Public/Donation/services/api.ts
new file mode 100644
index 000000000..7eb77e07e
--- /dev/null
+++ b/src/modules/Public/Donation/services/api.ts
@@ -0,0 +1,99 @@
+import toast from "react-hot-toast";
+import { publicGateway } from "@/MuLearnServices/apiGateways";
+import { donationRoutes } from "@/MuLearnServices/urls";
+
+declare global {
+ interface Window {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ Razorpay: any;
+ }
+}
+
+export const submitForm = async ({
+ amount,
+ name,
+ email,
+ mobile,
+ pan
+}: {
+ amount: number;
+ name: string;
+ email: string;
+ mobile: number;
+ pan: string;
+
+}) => {
+
+ const script = document.createElement('script');
+ script.src = 'https://checkout.razorpay.com/v1/checkout.js';
+ document.body.appendChild(script);
+
+ publicGateway
+ .post(donationRoutes.order, {
+ amount,
+ name,
+ email,
+ mobile
+ })
+ .then((response) => {
+ const paymentId: string = response.data.response.id;
+ const paymentAmount: string = response.data.response.amount;
+
+ const options = {
+ key_id: import.meta.env.VITE_RAZORPAY_KEY_ID,
+ amount: paymentAmount,
+ currency: response.data.response.currency,
+ name: 'Gtech Mulearn',
+ description: 'Donation',
+ image: '/favicon.ico',
+ order_id: paymentId,
+ handler: function (response: any) {
+ console.log(response);
+
+ publicGateway
+ .post(donationRoutes.verify, {
+ razorpay_order_id: response.razorpay_order_id,
+ razorpay_payment_id: response.razorpay_payment_id,
+ razorpay_signature: response.razorpay_signature,
+ })
+ .then((res) => {
+ console.log(res?.data);
+ toast.success(res?.data?.message?.general[0] || 'Payment Successful');
+ // Assuming response.data contains the PDF data
+
+ const pdfData = res?.data;
+
+ // Create a new blob from the PDF data
+ const pdfBlob = new Blob([pdfData], { type: 'application/pdf' });
+
+ // Create a URL for the blob
+ const pdfUrl = URL.createObjectURL(pdfBlob);
+
+ // Open the PDF in a new window or tab
+ // window.open(pdfUrl, '_blank');
+ const link = document.createElement('a');
+ link.href = pdfUrl;
+ link.download = 'downloaded-file.pdf'; // Provide a filename here
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ })
+ .catch((error) => {
+ console.log(error);
+ toast.error(
+ JSON.stringify(error) || 'Error in Validating Payment',
+ );
+ });
+ },
+ theme: {
+ color: '#F37254',
+ },
+ };
+
+ const rzp1 = new window.Razorpay(options);
+ rzp1.open();
+ })
+ .catch((error) => {
+ toast.error(error?.response?.data?.message?.general[0] || 'Error in Registering Event');
+ });
+};
diff --git a/src/services/urls.ts b/src/services/urls.ts
index 9487778bf..56c1a14f1 100644
--- a/src/services/urls.ts
+++ b/src/services/urls.ts
@@ -175,7 +175,12 @@ export const dashboardRoutes = {
//Bulk User Role Management
roleBulkAssign: "api/v1/dashboard/roles/bulk-assign/",
roleBulkAssignExcel: "api/v1/dashboard/roles/bulk-assign-excel/",
- getRolesTemplate: "api/v1/dashboard/roles/base-template/"
+ getRolesTemplate: "api/v1/dashboard/roles/base-template/",
+
+ //Wadhwani
+ getWadhwaniClientToken: "api/v1/integrations/wadhwani/auth-token/",
+ getWadhwaniCourses: "api/v1/integrations/wadhwani/course-details/",
+ getWadhwaniCourseLink: "api/v1/integrations/wadhwani/user-login/",
} as const;
export const organizationRoutes = {
@@ -236,3 +241,8 @@ export const googleSheetRoutes = {
getHackathonDashboardData:
"https://opensheet.elk.sh/1cGUHmdPd8ticzuuEpkX6j7G5p7hU47SZvnvgUnd6xBk/Sheet1"
};
+
+export const donationRoutes = {
+ order: "api/v1/donate/order/",
+ verify : "api/v1/donate/verify/",
+}
\ No newline at end of file
diff --git a/vercel.json b/vercel.json
new file mode 100644
index 000000000..8ab392340
--- /dev/null
+++ b/vercel.json
@@ -0,0 +1,3 @@
+{
+ "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
+}
\ No newline at end of file