diff --git a/callbacks/admin/company/company.ts b/callbacks/admin/company/company.ts index 05cbfaac..8ab54a4a 100644 --- a/callbacks/admin/company/company.ts +++ b/callbacks/admin/company/company.ts @@ -3,7 +3,6 @@ import axios, { AxiosResponse } from "axios"; import { ADMIN_COMPANY_URL, - ADMIN_RC_URL, ErrorType, SERVER_ERROR, StatusResponse, @@ -27,23 +26,12 @@ export interface HR { phone: string; designation: string; } -export interface CompanyHistory { - id: number; - recruitmentDrive: string; - comments: string; -} const adminCompanyInstance = axios.create({ baseURL: ADMIN_COMPANY_URL, timeout: 15000, timeoutErrorMessage: SERVER_ERROR, }); -const adminRcInstance = axios.create({ - baseURL: ADMIN_RC_URL, - timeout: 15000, - timeoutErrorMessage: SERVER_ERROR, -}); - const addCompanyRequest = { post: (body: Company, token: string) => adminCompanyInstance @@ -170,19 +158,9 @@ const addCompanyRequest = { return false; }); }, - getCompanyHistory: (token: string, companyId: string) => - adminRcInstance - .get(`/company/${companyId}/history`, setConfig(token)) - .then(responseBody) - .catch((err: ErrorType) => { - errorNotification( - "Error in fetching Company History", - err.response?.data?.error || err.message - ); - return [] as CompanyHistory[]; - }), }; export default addCompanyRequest; + // get compnay, edit company, bulk add company // delete diff --git a/components/Layouts/LayoutWrapper.tsx b/components/Layouts/LayoutWrapper.tsx index 4f4af14f..6535db9b 100644 --- a/components/Layouts/LayoutWrapper.tsx +++ b/components/Layouts/LayoutWrapper.tsx @@ -434,7 +434,7 @@ function LayoutWrapper({ children }: { children: JSX.Element }) { role === 100 || role === 101 ? { avatar: , - name: "Master Database (Company HR)", + name: "Master Database (Company HR", id: "/companyHR", } : { avatar: <>, name: "", id: "", hidden: true }, diff --git a/sections/CompanyHistory.tsx b/sections/CompanyHistory.tsx index f3c1da88..32268356 100644 --- a/sections/CompanyHistory.tsx +++ b/sections/CompanyHistory.tsx @@ -1,13 +1,9 @@ -import { FormControl, Stack, TextField } from "@mui/material"; +import { FormControl, IconButton, Stack, TextField } from "@mui/material"; import { GridColDef } from "@mui/x-data-grid"; -import { useRouter } from "next/router"; -import React, { useEffect, useState } from "react"; +import React from "react"; +import MoreVertIcon from "@mui/icons-material/MoreVert"; import DataGrid from "@components/DataGrid"; -import addCompanyRequest, { - CompanyHistory, -} from "@callbacks/admin/company/company"; -import useStore from "@store/store"; const CompanyHistoryColumns: GridColDef[] = [ { @@ -16,15 +12,15 @@ const CompanyHistoryColumns: GridColDef[] = [ width: 150, }, { - field: "recruitmentCycleID", + field: "RecruitmentDrive", headerName: "Recruitment Drive", flex: 1, }, { - field: "comments", + field: "Comments", headerName: "Comments", flex: 1, - renderCell: (params) => ( + renderCell: () => ( + + + ), }, ]; -function CompanyHistory() { - const [companyHistoryRows, setCompanyHistoryRows] = useState< - CompanyHistory[] - >([]); - const { token } = useStore(); - const router = useRouter(); - - useEffect(() => { - const fetchCompanyHistory = async () => { - const companyId = router.query.companyId?.toString() || ""; - - const historyData = await addCompanyRequest.getCompanyHistory( - token, - companyId - ); - setCompanyHistoryRows(historyData); - }; - - fetchCompanyHistory(); - }, [router.query.companyId, token]); +const companyHistoryRows: never[] = []; +function CompanyHistory() { return (