({
- value: college.id,
- label: college.title
- }))
- : companies.map(
- company => ({
- value: company.id,
- label: company.title
- })
- ))
- ] as any
- }
+ onInputChange={e => {
+ setOrganizationInput(e);
+ }}
+ options={getOptions()}
name="organization"
placeholder={
isCollege
? "College"
: "Organization"
}
- value={selectedOrganization.title}
filterOption={CustomFilter}
isDisabled={isloading}
onChange={(e: any) => {
- setSelectedOrganization(e);
- formik.setFieldValue(
- "organization",
- e.value
- );
- inputObject.organization = e.value;
+ onOrgSelectChange(e, formik);
}}
/>
@@ -188,7 +223,7 @@ export default function CollegePage() {
{formik.errors.college}
)}
- {isCollege ? (
+ {isCollege && !createOrganization ? (
<>
{
e.preventDefault();
diff --git a/src/modules/Common/Authentication/services/onboardingApis.ts b/src/modules/Common/Authentication/services/onboardingApis.ts
index 75ec01e5e..148d74741 100644
--- a/src/modules/Common/Authentication/services/onboardingApis.ts
+++ b/src/modules/Common/Authentication/services/onboardingApis.ts
@@ -236,6 +236,31 @@ export const getCommunities = ({
setIsLoading && setIsLoading(false);
};
+export const createNewOrganization = async ({
+ setIsLoading,
+ org_data
+}: {
+ setIsLoading: Dispatch>;
+ org_data: Object;
+}) => {
+ try {
+ setIsLoading(true);
+ const res = await privateGateway.post(
+ "/api/v1/register/organization/create/",
+ org_data
+ );
+ if (res.status == 200 && !res.data.hasError) {
+ toast.success(res.data.message.general[0]);
+ return true;
+ } else {
+ toast.error("Organization selection failed.");
+ }
+ setIsLoading(false);
+ } catch (err: any) {
+ toast.error("Unable to select organization.");
+ }
+ return false;
+};
export const selectOrganization = async ({
setIsLoading,
userData
diff --git a/src/modules/Dashboard/layouts/DashboardRootLayout.tsx b/src/modules/Dashboard/layouts/DashboardRootLayout.tsx
index 628dea579..30a3fe8d0 100644
--- a/src/modules/Dashboard/layouts/DashboardRootLayout.tsx
+++ b/src/modules/Dashboard/layouts/DashboardRootLayout.tsx
@@ -182,6 +182,12 @@ const DashboardRootLayout = (props: { component?: any }) => {
hasView: true,
roles: [roles.ADMIN]
},
+ {
+ url: "/dashboard/verify-organizations",
+ title: "Verify Organization",
+ hasView: true,
+ roles: [roles.ADMIN, roles.FELLOW]
+ },
{
url: "/dashboard/college-levels",
title: "College Levels",
diff --git a/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcAttendeeReport.tsx b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcAttendeeReport.tsx
index 589c7a622..12330c671 100644
--- a/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcAttendeeReport.tsx
+++ b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcAttendeeReport.tsx
@@ -215,10 +215,10 @@ const LcReportAttendee = () => {
onChange={e => {
if (e.target.files) {
if (
- e.target.files[0].size > 5000000
+ e.target.files[0].size > 2500000
) {
toast.error(
- "File size should not exceed 5MB"
+ "File size should not exceed 2.5MB"
);
return;
}
diff --git a/src/modules/Dashboard/modules/VerifyOrganizations/VerifyOrganizationAPIs.tsx b/src/modules/Dashboard/modules/VerifyOrganizations/VerifyOrganizationAPIs.tsx
new file mode 100644
index 000000000..51fbc0382
--- /dev/null
+++ b/src/modules/Dashboard/modules/VerifyOrganizations/VerifyOrganizationAPIs.tsx
@@ -0,0 +1,20 @@
+import { privateGateway } from "@/MuLearnServices/apiGateways";
+import { organizationRoutes } from "@/MuLearnServices/urls";
+
+export const getUnverifiedOrganizations = async (
+ setData: UseStateFunc,
+ setIsLoading: UseStateFunc
+) => {
+ setIsLoading(true);
+ try {
+ const data = (
+ await privateGateway.get(
+ organizationRoutes.getUnverifiedOrganizations
+ )
+ ).data.response;
+ setIsLoading(false);
+ setData(data);
+ } catch (err: unknown) {
+ setIsLoading(false);
+ }
+};
diff --git a/src/modules/Dashboard/modules/VerifyOrganizations/VerifyOrganizations.tsx b/src/modules/Dashboard/modules/VerifyOrganizations/VerifyOrganizations.tsx
new file mode 100644
index 000000000..f54e3824e
--- /dev/null
+++ b/src/modules/Dashboard/modules/VerifyOrganizations/VerifyOrganizations.tsx
@@ -0,0 +1,64 @@
+import MuModal from "@/MuLearnComponents/MuModal/MuModal";
+import Pagination from "@/MuLearnComponents/Pagination/Pagination";
+import Table from "@/MuLearnComponents/Table/Table";
+import THead from "@/MuLearnComponents/Table/THead";
+import TableTop from "@/MuLearnComponents/TableTop/TableTop";
+import { useEffect, useState } from "react";
+import { Label } from "recharts";
+import { getUnverifiedOrganizations } from "./VerifyOrganizationAPIs";
+
+export default function VerifyOrganizations() {
+ const [data, setData] = useState([]);
+ const [isLoading, setIsLoading] = useState(false);
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const [currentPage, setCurrentPage] = useState(1);
+ const [totalPages, setTotalPages] = useState(0);
+ const [perPage, setPerPage] = useState(20);
+ const columns = [
+ { column: "title", Label: "Title", isSortable: false },
+ { column: "org_type", Label: "Org Type", isSortable: false },
+ { column: "created_by", Label: "Craeted By", isSortable: false },
+ { column: "created_at", Label: "Created At", isSortable: false }
+ ];
+ useEffect(() => {
+ getUnverifiedOrganizations(setData, setIsLoading);
+ }, []);
+
+ return (
+ <>
+ setIsModalOpen(false)}
+ title={`Verify Organization`}
+ type={"success"}
+ onDone={() => {}}
+ >
+ Nothing
+
+ {data && (
+ <>
+
+ {}}
+ action={false}
+ />
+
+
+ >
+ )}
+ >
+ );
+}
diff --git a/src/services/urls.ts b/src/services/urls.ts
index 5ad62b0b2..2f05ab020 100644
--- a/src/services/urls.ts
+++ b/src/services/urls.ts
@@ -220,6 +220,7 @@ export const organizationRoutes = {
putUpdateOrganization: "/api/v1/dashboard/organisation/institutes/edit/",
deleteOrgnaization: "/api/v1/dashboard/organisation/institutes/delete/",
postGetInfo: "/api/v1/dashboard/organisation/institutes/info/",
+ getUnverifiedOrganizations: "/api/v1/dashboard/organisation/verify/list/",
getOrgCsv: (org_type: string) =>
`/api/v1/dashboard/organisation/institutes/${org_type}/csv/`,