-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1661 from gtech-mulearn/dev
Dev Server
- Loading branch information
Showing
9 changed files
with
201 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/modules/Dashboard/modules/VerifyOrganizations/VerifyOrganizationAPIs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { privateGateway } from "@/MuLearnServices/apiGateways"; | ||
import { organizationRoutes } from "@/MuLearnServices/urls"; | ||
|
||
export const getUnverifiedOrganizations = async ( | ||
setData: UseStateFunc<any>, | ||
setIsLoading: UseStateFunc<boolean> | ||
) => { | ||
setIsLoading(true); | ||
try { | ||
const data = ( | ||
await privateGateway.get( | ||
organizationRoutes.getUnverifiedOrganizations | ||
) | ||
).data.response; | ||
setIsLoading(false); | ||
setData(data); | ||
} catch (err: unknown) { | ||
setIsLoading(false); | ||
} | ||
}; |
64 changes: 64 additions & 0 deletions
64
src/modules/Dashboard/modules/VerifyOrganizations/VerifyOrganizations.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<any[]>([]); | ||
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 ( | ||
<> | ||
<MuModal | ||
isOpen={isModalOpen} | ||
onClose={() => setIsModalOpen(false)} | ||
title={`Verify Organization`} | ||
type={"success"} | ||
onDone={() => {}} | ||
> | ||
Nothing | ||
</MuModal> | ||
{data && ( | ||
<> | ||
<Table | ||
rows={data} | ||
isloading={isLoading} | ||
page={currentPage} | ||
perPage={perPage} | ||
columnOrder={columns} | ||
id={["id"]} | ||
modalVerifyContent="Are you sure you want to verify this organization?" | ||
modalVerifyHeading="Verify Organization" | ||
// modalTypeContent="error" | ||
// modalDeleteContent={`Are you sure you want to delete this organization?`} | ||
// onDeleteClick={handleDelete} | ||
> | ||
<THead | ||
columnOrder={columns} | ||
onIconClick={() => {}} | ||
action={false} | ||
/> | ||
<div></div> | ||
</Table> | ||
</> | ||
)} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters