Skip to content

Commit

Permalink
quick fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan-tf committed Jul 14, 2024
1 parent 5b7a9fb commit 344b8e2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/app/(routes)/admin/jobs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const JobPage = () => {

useEffect(() => {
const getData = async () => {
const data = await fetchAllJobs( undefined);
const data = await fetchAllJobs();
setAllJobs(data);
setLoading(false);
};
Expand Down
11 changes: 1 addition & 10 deletions src/app/(routes)/admin/recruiters/page.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
"use client";
import { fetchRecruiterData } from "@/helpers/api";
import Cookies from "js-cookie";
import Table from "@/components/NewTableComponent/Table";
import type {DTO} from '@/dto/StudentDto'
import {
MaterialReactTable,
useMaterialReactTable,
type MRT_Row,
createMRTColumnHelper,
} from 'material-react-table';
import generateColumns from "@/components/NewTableComponent/ColumnMapping";
import { recruiterdto } from "@/dto/RecruiterDto";
import type { RecruiterDTO } from "@/dto/RecruiterDto";

const hiddenColumns = ['id','user.id','company.id'];


const StudentPage = async () => {
const columns = generateColumns(recruiterdto)
console.log(columns)
const AllRecruiters = await fetchRecruiterData(null);
const AllRecruiters = await fetchRecruiterData();
const visibleColumns = columns.filter(
(column:any) => !hiddenColumns.includes(column?.accessorKey)
);
Expand Down
15 changes: 2 additions & 13 deletions src/app/(routes)/admin/students/page.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
"use client";
import { useState, useEffect } from 'react';
import { fetchStudentData, } from "@/helpers/api";
import Cookies from "js-cookie";
import Table from "@/components/NewTableComponent/Table";
import type { DTO } from '@/dto/StudentDto';
import { createMRTColumnHelper } from 'material-react-table';
import generateColumns from "@/components/NewTableComponent/ColumnMapping";
import { jsondto } from "@/dto/StudentDto";
import { Form } from 'antd';
import { cookies } from 'next/headers';

const hiddenColumns = ['userId', 'programId','id'];

const StudentPage = () => {
const [students, setStudents] = useState<DTO[]>([]);
const columnHelper = createMRTColumnHelper<DTO>();
const columns = generateColumns(jsondto);






const visibleColumns = columns.filter(
(column: any) => !hiddenColumns.includes(column?.accessorKey)
);

useEffect(() => {
const fetchData = async () => {
const data = await fetchStudentData(null);
const data = await fetchStudentData();
setStudents(data);
console.log(data);
};


fetchData();
}, []);

Expand Down
2 changes: 0 additions & 2 deletions src/components/NewTableComponent/StudentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
import Paper from '@mui/material/Paper';
import { useEffect, useState } from 'react';
import CircularProgress from '@mui/material/CircularProgress';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { grey } from '@mui/material/colors';
import { Button } from '@mui/material';
import {fetchRegistrations} from '@/helpers/api';
import Cookies from 'js-cookie';
import Loader from '@/components/Loader/loader';
import { fetchStudentDataById, fetchRegistrationDataById } from '@/helpers/api';
const redirect = () => {};
Expand Down
2 changes: 0 additions & 2 deletions src/components/TableComponent/TableComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import * as React from "react";
import { useState } from "react";
import Modal from "react-modal";
import { fetchStudentData } from "@/helpers/api";
import Cookies from "js-cookie";
import {
ColumnDef,
ColumnFiltersState,
Expand Down
9 changes: 3 additions & 6 deletions src/helpers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ export const assignRecruiter = async (
};

export const fetchAllJobs = async (

filter: string | undefined
filter?: string
) => {
return apiCall(filter ? `/jobs?${filter}` : "/jobs", {

Expand All @@ -174,8 +173,7 @@ export const fetchAllJobs = async (
};

export const fetchStudentData = async (

filter: string | undefined
filter?: string
) => {
return apiCall(filter ? `/students?${filter}` : "/students", {

Expand Down Expand Up @@ -256,8 +254,7 @@ export const promoteStudent = async (body: any, eventId: string) => {
};

export const fetchRecruiterData = async (

filter: string | undefined
filter?: string
) => {

return apiCall(filter ? `/recruiters?${filter}` : "/recruiters", {
Expand Down

0 comments on commit 344b8e2

Please sign in to comment.