diff --git a/components/applicantsDisplay.tsx b/components/Organizer/ApplicantsTab/ApplicantsTab.tsx
similarity index 93%
rename from components/applicantsDisplay.tsx
rename to components/Organizer/ApplicantsTab/ApplicantsTab.tsx
index 0c3d3bab..5fa9cac2 100644
--- a/components/applicantsDisplay.tsx
+++ b/components/Organizer/ApplicantsTab/ApplicantsTab.tsx
@@ -1,7 +1,7 @@
import { Table, Tag, Button, Checkbox, Modal, Input, Popover, Space } from 'antd';
import type { InputRef } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
-import { ApplicationStatus, UserData } from '../types/database';
+import { ApplicationStatus, UserData } from '../../../types/database';
import {
CheckCircleOutlined,
EyeOutlined,
@@ -12,13 +12,10 @@ import {
import { DateTime } from 'luxon';
import type { ColumnsType, FilterValue, FilterConfirmProps } from 'antd/es/table/interface';
import { useSWRConfig } from 'swr';
-import { ScopedMutator } from 'swr/dist/types';
import Highlighter from 'react-highlight-words';
-import { handleSubmitFailure, handleSubmitSuccess } from '../lib/helpers';
-
-export interface ApplicantsDisplayProps {
- hackers: UserData[];
-}
+import { handleSubmitFailure, handleSubmitSuccess } from '../../../lib/helpers';
+import { ScopedMutator } from 'swr/dist/types';
+import { RequestType, useCustomSWR } from '../../../utils/request-utils';
const APPLICATION_STATUSES = [
'Created',
@@ -74,7 +71,7 @@ const APPLICATION_KEY_MAP = {
mlhComms: 'MLH Communications',
};
-const acceptReject = (id: string, applicationStatus: ApplicationStatus, mutate: ScopedMutator, hackers: any) => {
+const acceptReject = (id: string, applicationStatus: ApplicationStatus, mutate: ScopedMutator, hackers: UserData[]) => {
fetch('/api/accept-reject', {
method: 'POST',
headers: {
@@ -86,7 +83,7 @@ const acceptReject = (id: string, applicationStatus: ApplicationStatus, mutate:
}),
}).then(() => {
const newHackers: UserData[] = JSON.parse(JSON.stringify(hackers)); // Deep copies the object
- const idx = newHackers.findIndex((x: any) => x._id === id);
+ const idx = newHackers.findIndex((x: UserData) => x._id.toString() === id);
newHackers[idx].applicationStatus = applicationStatus;
mutate(
'/api/users?usertype=HACKER',
@@ -98,7 +95,7 @@ const acceptReject = (id: string, applicationStatus: ApplicationStatus, mutate:
});
};
-const createPopover = (record: any, mutate: ScopedMutator, hackers: any) => {
+const createPopover = (record: any, mutate: ScopedMutator, hackers: UserData[]) => {
return (