From 5fe4be4942acf69247b363aab7a5fb9027f9f84a Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Fri, 12 Jul 2024 16:06:22 +0530 Subject: [PATCH 1/3] Issue : feat:#PS-1291 integrate mycohort ap and fetch centers --- src/pages/faciliator.tsx | 116 ++++++++++++++++++++++----------------- src/pages/learners.tsx | 112 ++++++++++++++++++++----------------- src/pages/teamLeader.tsx | 109 +++++++++++++++++++++--------------- src/services/userList.ts | 16 ++++++ 4 files changed, 210 insertions(+), 143 deletions(-) diff --git a/src/pages/faciliator.tsx b/src/pages/faciliator.tsx index 3baa453c..9d2ebc21 100644 --- a/src/pages/faciliator.tsx +++ b/src/pages/faciliator.tsx @@ -1,9 +1,8 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import KaTableComponent from "../components/KaTableComponent"; import { DataType } from "ka-table/enums"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; -import { userList } from "../services/userList"; -import { useState, useEffect } from "react"; +import { userList, getCohortList } from "../services/userList"; import UserComponent from "@/components/UserComponent"; import { useTranslation } from "next-i18next"; @@ -11,6 +10,7 @@ import Pagination from "@mui/material/Pagination"; import { SelectChangeEvent } from "@mui/material/Select"; import PageSizeSelector from "@/components/PageSelector"; + type UserDetails = { userId: any; username: any; @@ -20,6 +20,15 @@ type UserDetails = { centers?: any; Programs?: any; }; + +interface Cohort { + cohortId: string; + name: string; + parentId: string | null; + type: string; + customField: any[]; +} + const columns = [ // { // key: "userId", @@ -47,52 +56,42 @@ const columns = [ dataType: DataType.String, }, ]; -const Faciliators: React.FC = () => { + +const Facilitators: React.FC = () => { const [selectedState, setSelectedState] = useState("All states"); const [selectedDistrict, setSelectedDistrict] = useState("All Districts"); const [selectedBlock, setSelectedBlock] = useState("All Blocks"); const [selectedSort, setSelectedSort] = useState("Sort"); const [pageOffset, setPageOffset] = useState(0); const [pageLimit, setPageLimit] = useState(10); - const [data, setData] = useState([]); + const [cohortsFetched, setCohortsFetched] = useState(false); const { t } = useTranslation(); const [pageSize, setPageSize] = React.useState(""); - const [open, setOpen] = React.useState(false); + const [sortBy, setSortBy] = useState(["createdAt", "asc"]); + const [pageCount, setPageCount] = useState(1); const handleChange = (event: SelectChangeEvent) => { setPageSize(event.target.value); setPageLimit(Number(event.target.value)); }; - const handleClose = () => { - setOpen(false); + + const handlePaginationChange = (event: React.ChangeEvent, value: number) => { + setPageOffset(value - 1); }; - const handleOpen = () => { - setOpen(true); - }; const PagesSelector = () => ( - <> - - + ); - const handlePaginationChange = ( - event: React.ChangeEvent, - value: number - ) => { - setPageOffset(value - 1); - }; - const PageSizeSelectorFunction = ({}) => ( - <> - - + const PageSizeSelectorFunction = () => ( + ); const handleStateChange = (event: SelectChangeEvent) => { @@ -106,47 +105,61 @@ const Faciliators: React.FC = () => { const handleBlockChange = (event: SelectChangeEvent) => { setSelectedBlock(event.target.value as string); }; + const handleSortChange = async (event: SelectChangeEvent) => { //console.log(event.target.value) - try { - const limit = pageLimit; - const offset = pageOffset; - let sort; + + // let sort; if (event.target.value === "Z-A") { - sort = ["name", "desc"]; + setSortBy(["name", "desc"]); } else if (event.target.value === "A-Z") { - sort = ["name", "asc"]; + setSortBy(["name", "asc"]); } else { - sort = ["createdAt", "asc"]; + setSortBy(["createdAt", "asc"]); } - const filters = { role: "Teacher" }; - const resp = await userList({ limit, filters, sort, offset }); - const result = resp?.getUserDetails; - - setData(result[0]); - } catch (error) { - console.error("Error fetching user list:", error); - } + setSelectedSort(event.target.value as string); }; useEffect(() => { const fetchUserList = async () => { try { const limit = pageLimit; - // const page = 0; - const offset = pageOffset; - // const sort = ["createdAt", "asc"]; + const offset = pageOffset*limit; const filters = { role: "Teacher" }; - const resp = await userList({ limit, filters, offset }); + const sort=sortBy + const resp = await userList({ limit, filters, sort, offset }); const result = resp?.getUserDetails; + // console.log(resp?.totalCount) + setPageCount(Math.ceil(resp?.totalCount/pageLimit)); - setData(result[0]); + setData(result); + setCohortsFetched(false); } catch (error) { console.error("Error fetching user list:", error); } }; fetchUserList(); - }, [pageOffset, pageLimit]); + }, [pageOffset, pageLimit, sortBy]); + + useEffect(() => { + const fetchData = async () => { + if (data.length === 0 || cohortsFetched) return; + const newData = await Promise.all(data.map(async (user) => { + const response = await getCohortList(user.userId); + const cohortNames = response?.result?.cohortData?.map((cohort: Cohort) => cohort.name); + + return { + ...user, + centers: cohortNames, + }; + })); + + setData(newData); + setCohortsFetched(true); + }; + + fetchData(); + }, [data, cohortsFetched]); const userProps = { userType: t("SIDEBAR.FACILITATORS"), @@ -160,6 +173,7 @@ const Faciliators: React.FC = () => { handleBlockChange: handleBlockChange, handleSortChange: handleSortChange, }; + return (
@@ -184,4 +198,4 @@ export async function getStaticProps({ locale }: any) { }; } -export default Faciliators; +export default Facilitators; diff --git a/src/pages/learners.tsx b/src/pages/learners.tsx index 6e9ef2a5..c68f2732 100644 --- a/src/pages/learners.tsx +++ b/src/pages/learners.tsx @@ -1,9 +1,8 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import KaTableComponent from "../components/KaTableComponent"; import { DataType } from "ka-table/enums"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; -import { userList } from "../services/userList"; -import { useState, useEffect } from "react"; +import { userList, getCohortList } from "../services/userList"; import UserComponent from "@/components/UserComponent"; import { useTranslation } from "next-i18next"; @@ -11,6 +10,7 @@ import Pagination from "@mui/material/Pagination"; import { SelectChangeEvent } from "@mui/material/Select"; import PageSizeSelector from "@/components/PageSelector"; + type UserDetails = { userId: any; username: any; @@ -20,6 +20,15 @@ type UserDetails = { centers?: any; Programs?: any; }; + +interface Cohort { + cohortId: string; + name: string; + parentId: string | null; + type: string; + customField: any[]; +} + const columns = [ // { // key: "userId", @@ -47,6 +56,7 @@ const columns = [ dataType: DataType.String, }, ]; + const Learners: React.FC = () => { const [selectedState, setSelectedState] = useState("All states"); const [selectedDistrict, setSelectedDistrict] = useState("All Districts"); @@ -54,45 +64,34 @@ const Learners: React.FC = () => { const [selectedSort, setSelectedSort] = useState("Sort"); const [pageOffset, setPageOffset] = useState(0); const [pageLimit, setPageLimit] = useState(10); - const [data, setData] = useState([]); + const [cohortsFetched, setCohortsFetched] = useState(false); const { t } = useTranslation(); const [pageSize, setPageSize] = React.useState(""); - const [open, setOpen] = React.useState(false); + const [sortBy, setSortBy] = useState(["createdAt", "asc"]); + const [pageCount, setPageCount] = useState(1); const handleChange = (event: SelectChangeEvent) => { setPageSize(event.target.value); setPageLimit(Number(event.target.value)); }; - const handleClose = () => { - setOpen(false); + + const handlePaginationChange = (event: React.ChangeEvent, value: number) => { + setPageOffset(value - 1); }; - const handleOpen = () => { - setOpen(true); - }; const PagesSelector = () => ( - <> - - + ); - const handlePaginationChange = ( - event: React.ChangeEvent, - value: number - ) => { - setPageOffset(value - 1); - }; - const PageSizeSelectorFunction = ({}) => ( - <> - - + const PageSizeSelectorFunction = () => ( + ); const handleStateChange = (event: SelectChangeEvent) => { @@ -106,47 +105,61 @@ const Learners: React.FC = () => { const handleBlockChange = (event: SelectChangeEvent) => { setSelectedBlock(event.target.value as string); }; + const handleSortChange = async (event: SelectChangeEvent) => { //console.log(event.target.value) - try { - const limit = pageLimit; - const offset = pageOffset; - let sort; + + // let sort; if (event.target.value === "Z-A") { - sort = ["name", "desc"]; + setSortBy(["name", "desc"]); } else if (event.target.value === "A-Z") { - sort = ["name", "asc"]; + setSortBy(["name", "asc"]); } else { - sort = ["createdAt", "asc"]; + setSortBy(["createdAt", "asc"]); } - const filters = { role: "Student" }; - const resp = await userList({ limit, filters, sort, offset }); - const result = resp?.getUserDetails; - - setData(result[0]); - } catch (error) { - console.error("Error fetching user list:", error); - } + setSelectedSort(event.target.value as string); }; useEffect(() => { const fetchUserList = async () => { try { const limit = pageLimit; - // const page = 0; - const offset = pageOffset; - // const sort = ["createdAt", "asc"]; + const offset = pageOffset*limit; const filters = { role: "Student" }; - const resp = await userList({ limit, filters, offset }); + const sort=sortBy + const resp = await userList({ limit, filters, sort, offset }); const result = resp?.getUserDetails; + // console.log(resp?.totalCount) + setPageCount(Math.ceil(resp?.totalCount/pageLimit)); - setData(result[0]); + setData(result); + setCohortsFetched(false); } catch (error) { console.error("Error fetching user list:", error); } }; fetchUserList(); - }, [pageOffset, pageLimit]); + }, [pageOffset, pageLimit, sortBy]); + + useEffect(() => { + const fetchData = async () => { + if (data.length === 0 || cohortsFetched) return; + const newData = await Promise.all(data.map(async (user) => { + const response = await getCohortList(user.userId); + const cohortNames = response?.result?.cohortData?.map((cohort: Cohort) => cohort.name); + + return { + ...user, + centers: cohortNames, + }; + })); + + setData(newData); + setCohortsFetched(true); + }; + + fetchData(); + }, [data, cohortsFetched]); const userProps = { userType: t("SIDEBAR.LEARNERS"), @@ -160,6 +173,7 @@ const Learners: React.FC = () => { handleBlockChange: handleBlockChange, handleSortChange: handleSortChange, }; + return (
diff --git a/src/pages/teamLeader.tsx b/src/pages/teamLeader.tsx index 2c8ce30a..94ec8d66 100644 --- a/src/pages/teamLeader.tsx +++ b/src/pages/teamLeader.tsx @@ -1,9 +1,8 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import KaTableComponent from "../components/KaTableComponent"; import { DataType } from "ka-table/enums"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; -import { userList } from "../services/userList"; -import { useState, useEffect } from "react"; +import { userList, getCohortList } from "../services/userList"; import UserComponent from "@/components/UserComponent"; import { useTranslation } from "next-i18next"; @@ -11,6 +10,7 @@ import Pagination from "@mui/material/Pagination"; import { SelectChangeEvent } from "@mui/material/Select"; import PageSizeSelector from "@/components/PageSelector"; + type UserDetails = { userId: any; username: any; @@ -20,6 +20,15 @@ type UserDetails = { centers?: any; Programs?: any; }; + +interface Cohort { + cohortId: string; + name: string; + parentId: string | null; + type: string; + customField: any[]; +} + const columns = [ // { // key: "userId", @@ -47,6 +56,7 @@ const columns = [ dataType: DataType.String, }, ]; + const TeamLeader: React.FC = () => { const [selectedState, setSelectedState] = useState("All states"); const [selectedDistrict, setSelectedDistrict] = useState("All Districts"); @@ -54,36 +64,34 @@ const TeamLeader: React.FC = () => { const [selectedSort, setSelectedSort] = useState("Sort"); const [pageOffset, setPageOffset] = useState(0); const [pageLimit, setPageLimit] = useState(10); - const [data, setData] = useState([]); + const [cohortsFetched, setCohortsFetched] = useState(false); const { t } = useTranslation(); const [pageSize, setPageSize] = React.useState(""); + const [sortBy, setSortBy] = useState(["createdAt", "asc"]); + const [pageCount, setPageCount] = useState(1); const handleChange = (event: SelectChangeEvent) => { setPageSize(event.target.value); setPageLimit(Number(event.target.value)); }; - const PagesSelector = () => ( - <> - - - ); - const handlePaginationChange = ( - event: React.ChangeEvent, - value: number - ) => { + + + const handlePaginationChange = (event: React.ChangeEvent, value: number) => { setPageOffset(value - 1); }; - const PageSizeSelectorFunction = ({}) => ( - <> - - + const PagesSelector = () => ( + + ); + + const PageSizeSelectorFunction = () => ( + ); const handleStateChange = (event: SelectChangeEvent) => { @@ -97,47 +105,61 @@ const TeamLeader: React.FC = () => { const handleBlockChange = (event: SelectChangeEvent) => { setSelectedBlock(event.target.value as string); }; + const handleSortChange = async (event: SelectChangeEvent) => { //console.log(event.target.value) - try { - const limit = pageLimit; - const offset = pageOffset; - let sort; + + // let sort; if (event.target.value === "Z-A") { - sort = ["name", "desc"]; + setSortBy(["name", "desc"]); } else if (event.target.value === "A-Z") { - sort = ["name", "asc"]; + setSortBy(["name", "asc"]); } else { - sort = ["createdAt", "asc"]; + setSortBy(["createdAt", "asc"]); } - const filters = { role: "Team Leader" }; - const resp = await userList({ limit, filters, sort, offset }); - const result = resp?.getUserDetails; - - setData(result[0]); - } catch (error) { - console.error("Error fetching user list:", error); - } + setSelectedSort(event.target.value as string); }; useEffect(() => { const fetchUserList = async () => { try { const limit = pageLimit; - // const page = 0; - const offset = pageOffset; - // const sort = ["createdAt", "asc"]; + const offset = pageOffset*limit; const filters = { role: "Team Leader" }; - const resp = await userList({ limit, filters, offset }); + const sort=sortBy + const resp = await userList({ limit, filters, sort, offset }); const result = resp?.getUserDetails; + // console.log(resp?.totalCount) + setPageCount(Math.ceil(resp?.totalCount/pageLimit)); - setData(result[0]); + setData(result); + setCohortsFetched(false); } catch (error) { console.error("Error fetching user list:", error); } }; fetchUserList(); - }, [pageOffset, pageLimit]); + }, [pageOffset, pageLimit, sortBy]); + + useEffect(() => { + const fetchData = async () => { + if (data.length === 0 || cohortsFetched) return; + const newData = await Promise.all(data.map(async (user) => { + const response = await getCohortList(user.userId); + const cohortNames = response?.result?.cohortData?.map((cohort: Cohort) => cohort.name); + + return { + ...user, + centers: cohortNames, + }; + })); + + setData(newData); + setCohortsFetched(true); + }; + + fetchData(); + }, [data, cohortsFetched]); const userProps = { userType: t("SIDEBAR.TEAM_LEADERS"), @@ -151,6 +173,7 @@ const TeamLeader: React.FC = () => { handleBlockChange: handleBlockChange, handleSortChange: handleSortChange, }; + return (
diff --git a/src/services/userList.ts b/src/services/userList.ts index c2f93cb0..1d753e69 100644 --- a/src/services/userList.ts +++ b/src/services/userList.ts @@ -1,4 +1,5 @@ import { post } from "./RestClient"; +import { get } from "./RestClient"; export interface userListParam { limit: number; @@ -27,4 +28,19 @@ export interface userListParam { throw error; } }; + + + export const getCohortList = async ( + userId: string | string[], + + ): Promise => { + const apiUrl: string = `${process.env.NEXT_PUBLIC_BASE_URL}/cohort/mycohorts/${userId}`; + try { + const response = await get(apiUrl); + return response?.data; + } catch (error) { + console.error('error in fetching user details', error); + return error; + } + }; \ No newline at end of file From c8814be755529b7a6aec88d1e9925c4390f7a263 Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Fri, 12 Jul 2024 17:10:06 +0530 Subject: [PATCH 2/3] update PR: create separate service for getcohortlist --- src/pages/faciliator.tsx | 3 +- src/pages/learners.tsx | 70 +++++++++++++++++------------------ src/pages/teamLeader.tsx | 4 +- src/services/getCohortList.ts | 15 ++++++++ 4 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 src/services/getCohortList.ts diff --git a/src/pages/faciliator.tsx b/src/pages/faciliator.tsx index 9d2ebc21..d778d666 100644 --- a/src/pages/faciliator.tsx +++ b/src/pages/faciliator.tsx @@ -2,7 +2,8 @@ import React, { useState, useEffect } from "react"; import KaTableComponent from "../components/KaTableComponent"; import { DataType } from "ka-table/enums"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; -import { userList, getCohortList } from "../services/userList"; +import { userList} from "../services/userList"; +import { getCohortList } from "../services/getCohortList"; import UserComponent from "@/components/UserComponent"; import { useTranslation } from "next-i18next"; diff --git a/src/pages/learners.tsx b/src/pages/learners.tsx index c68f2732..6b2a2a9c 100644 --- a/src/pages/learners.tsx +++ b/src/pages/learners.tsx @@ -2,14 +2,15 @@ import React, { useState, useEffect } from "react"; import KaTableComponent from "../components/KaTableComponent"; import { DataType } from "ka-table/enums"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; -import { userList, getCohortList } from "../services/userList"; +import { userList} from "../services/userList"; +import { getCohortList } from "../services/getCohortList"; import UserComponent from "@/components/UserComponent"; import { useTranslation } from "next-i18next"; - import Pagination from "@mui/material/Pagination"; - import { SelectChangeEvent } from "@mui/material/Select"; import PageSizeSelector from "@/components/PageSelector"; +import IconButton from '@mui/material/IconButton'; +import MoreVertIcon from '@mui/icons-material/MoreVert'; type UserDetails = { userId: any; @@ -19,6 +20,7 @@ type UserDetails = { mobile: any; centers?: any; Programs?: any; + actions?: any; }; interface Cohort { @@ -30,11 +32,6 @@ interface Cohort { } const columns = [ - // { - // key: "userId", - // title: "ID", - // dataType: DataType.String, - // }, { key: "name", title: "Name", @@ -53,7 +50,7 @@ const columns = [ { key: "actions", title: "Actions", - dataType: DataType.String, + dataType: DataType.Object, }, ]; @@ -67,7 +64,7 @@ const Learners: React.FC = () => { const [data, setData] = useState([]); const [cohortsFetched, setCohortsFetched] = useState(false); const { t } = useTranslation(); - const [pageSize, setPageSize] = React.useState(""); + const [pageSize, setPageSize] = useState(""); const [sortBy, setSortBy] = useState(["createdAt", "asc"]); const [pageCount, setPageCount] = useState(1); @@ -76,7 +73,6 @@ const Learners: React.FC = () => { setPageLimit(Number(event.target.value)); }; - const handlePaginationChange = (event: React.ChangeEvent, value: number) => { setPageOffset(value - 1); }; @@ -107,31 +103,26 @@ const Learners: React.FC = () => { }; const handleSortChange = async (event: SelectChangeEvent) => { - //console.log(event.target.value) - - // let sort; - if (event.target.value === "Z-A") { - setSortBy(["name", "desc"]); - } else if (event.target.value === "A-Z") { - setSortBy(["name", "asc"]); - } else { - setSortBy(["createdAt", "asc"]); - } - + if (event.target.value === "Z-A") { + setSortBy(["name", "desc"]); + } else if (event.target.value === "A-Z") { + setSortBy(["name", "asc"]); + } else { + setSortBy(["createdAt", "asc"]); + } setSelectedSort(event.target.value as string); }; + useEffect(() => { const fetchUserList = async () => { try { const limit = pageLimit; - const offset = pageOffset*limit; + const offset = pageOffset * limit; const filters = { role: "Student" }; - const sort=sortBy + const sort = sortBy; const resp = await userList({ limit, filters, sort, offset }); const result = resp?.getUserDetails; - // console.log(resp?.totalCount) - setPageCount(Math.ceil(resp?.totalCount/pageLimit)); - + setPageCount(Math.ceil(resp?.totalCount / pageLimit)); setData(result); setCohortsFetched(false); } catch (error) { @@ -144,15 +135,22 @@ const Learners: React.FC = () => { useEffect(() => { const fetchData = async () => { if (data.length === 0 || cohortsFetched) return; - const newData = await Promise.all(data.map(async (user) => { - const response = await getCohortList(user.userId); - const cohortNames = response?.result?.cohortData?.map((cohort: Cohort) => cohort.name); - - return { - ...user, - centers: cohortNames, - }; - })); + const newData = await Promise.all( + data.map(async (user) => { + const response = await getCohortList(user.userId); + const cohortNames = response?.result?.cohortData?.map((cohort: Cohort) => cohort.name); + + return { + ...user, + centers: cohortNames, + actions: ( + + + + ), + }; + }) + ); setData(newData); setCohortsFetched(true); diff --git a/src/pages/teamLeader.tsx b/src/pages/teamLeader.tsx index 94ec8d66..70bda40c 100644 --- a/src/pages/teamLeader.tsx +++ b/src/pages/teamLeader.tsx @@ -2,7 +2,9 @@ import React, { useState, useEffect } from "react"; import KaTableComponent from "../components/KaTableComponent"; import { DataType } from "ka-table/enums"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; -import { userList, getCohortList } from "../services/userList"; +import { userList } from "../services/userList"; +import { getCohortList } from "../services/getCohortList"; + import UserComponent from "@/components/UserComponent"; import { useTranslation } from "next-i18next"; diff --git a/src/services/getCohortList.ts b/src/services/getCohortList.ts new file mode 100644 index 00000000..c16be73a --- /dev/null +++ b/src/services/getCohortList.ts @@ -0,0 +1,15 @@ +import { get } from "./RestClient"; +export const getCohortList = async ( + userId: string | string[], + + ): Promise => { + const apiUrl: string = `${process.env.NEXT_PUBLIC_BASE_URL}/cohort/mycohorts/${userId}`; + try { + const response = await get(apiUrl); + return response?.data; + } catch (error) { + console.error('error in fetching user details', error); + return error; + } + }; + \ No newline at end of file From a63c11420225e0ebcb21ca7a82b3a4894affee49 Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Fri, 12 Jul 2024 17:14:48 +0530 Subject: [PATCH 3/3] update PR --- src/pages/learners.tsx | 10 ++-------- src/services/userList.ts | 14 -------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/pages/learners.tsx b/src/pages/learners.tsx index 6b2a2a9c..81d898e0 100644 --- a/src/pages/learners.tsx +++ b/src/pages/learners.tsx @@ -9,8 +9,6 @@ import { useTranslation } from "next-i18next"; import Pagination from "@mui/material/Pagination"; import { SelectChangeEvent } from "@mui/material/Select"; import PageSizeSelector from "@/components/PageSelector"; -import IconButton from '@mui/material/IconButton'; -import MoreVertIcon from '@mui/icons-material/MoreVert'; type UserDetails = { userId: any; @@ -50,7 +48,7 @@ const columns = [ { key: "actions", title: "Actions", - dataType: DataType.Object, + dataType: DataType.String, }, ]; @@ -143,11 +141,7 @@ const Learners: React.FC = () => { return { ...user, centers: cohortNames, - actions: ( - - - - ), + }; }) ); diff --git a/src/services/userList.ts b/src/services/userList.ts index 1d753e69..d40bbc0a 100644 --- a/src/services/userList.ts +++ b/src/services/userList.ts @@ -1,5 +1,4 @@ import { post } from "./RestClient"; -import { get } from "./RestClient"; export interface userListParam { limit: number; @@ -30,17 +29,4 @@ export interface userListParam { }; - export const getCohortList = async ( - userId: string | string[], - - ): Promise => { - const apiUrl: string = `${process.env.NEXT_PUBLIC_BASE_URL}/cohort/mycohorts/${userId}`; - try { - const response = await get(apiUrl); - return response?.data; - } catch (error) { - console.error('error in fetching user details', error); - return error; - } - }; \ No newline at end of file