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 (
+ {potentialScheduleA && potentialScheduleB && ( + + )} + +
+ {isScheduleImpossible() ? ( +
The schedule is impossible! Run.
+ ) : ( +
The schedule is possible!
+ )} +
Count of Teams: {teamsData?.length}
+
Count of Judges: {judgesData?.length}
+ Expo A + {potentialScheduleA && ( + ): void { + throw new Error('Function not implemented.'); + }} + sessionTimeStart={new Date('2022-10-23T10:00:00')} + sessionTimeEnd={new Date('2022-10-23T11:00:00')} + /> + )} +
+ Expo B + {potentialScheduleB && ( + ): void { + throw new Error('Function not implemented.'); + }} + sessionTimeStart={new Date('2022-10-23T11:30:00')} + sessionTimeEnd={new Date('2022-10-23T12:30:00')} + /> + )} + + )} + + ); +}; + +export default ScheduleTab; diff --git a/components/LeaveButton.tsx b/components/hacker/LeaveButton.tsx similarity index 75% rename from components/LeaveButton.tsx rename to components/hacker/LeaveButton.tsx index 1f64cbf1..5e83183b 100644 --- a/components/LeaveButton.tsx +++ b/components/hacker/LeaveButton.tsx @@ -2,7 +2,7 @@ import { Button, Popconfirm } from 'antd'; import { useSWRConfig } from 'swr'; import { ScopedMutator } from 'swr/dist/types'; -export default function LeaveButton({ onLeave }: { onLeave: (mutate: ScopedMutator) => Promise }) { +const LeaveButton = ({ onLeave }: { onLeave: (mutate: ScopedMutator) => Promise }) => { const { mutate } = useSWRConfig(); return ( ); -} +}; + +export default LeaveButton; diff --git a/components/TeamCard.tsx b/components/hacker/TeamCard.tsx similarity index 94% rename from components/TeamCard.tsx rename to components/hacker/TeamCard.tsx index aaaf9ba0..aa1cc808 100644 --- a/components/TeamCard.tsx +++ b/components/hacker/TeamCard.tsx @@ -1,5 +1,5 @@ import { Button, Card, Form, Input } from 'antd'; -import { NewTeamFields } from '../types/client'; +import { NewTeamFields } from '../../types/client'; interface Props { title: string; diff --git a/components/hacker/TeamManager.tsx b/components/hacker/TeamManager.tsx index 337aced0..401c78c5 100644 --- a/components/hacker/TeamManager.tsx +++ b/components/hacker/TeamManager.tsx @@ -1,13 +1,13 @@ import { Button, Collapse, Descriptions, Divider, Form, Input, notification, Tag } from 'antd'; import { Content } from 'antd/lib/layout/layout'; import { useSWRConfig } from 'swr'; -import { ScopedMutator } from 'swr/dist/types'; import { handleSubmitFailure } from '../../lib/helpers'; import { TeamProfile } from '../../types/client'; -import LeaveButton from '../LeaveButton'; +import LeaveButton from './LeaveButton'; +import { ScopedMutator } from 'swr/dist/types'; const { Panel } = Collapse; -async function handleSubmit(formData: { teamName: string } | { devpost: string }, mutate: ScopedMutator) { +async function handleSubmit(formData: { teamName: string } | { devpost: string }, mutate: ScopedMutator) { const res = await fetch('/api/team-management', { method: 'PATCH', headers: { @@ -24,7 +24,7 @@ async function handleSubmit(formData: { teamName: string } | { devpost: string } return false; } -async function handleLeaveTeam(mutate: ScopedMutator) { +async function handleLeaveTeam(mutate: ScopedMutator) { const res = await fetch('/api/team-management', { method: 'DELETE', headers: { @@ -41,7 +41,7 @@ async function handleLeaveTeam(mutate: ScopedMutator) { export default function TeamManager({ profile }: { profile: TeamProfile }) { // TODO: STYLE THIS! const { name, joinCode, devpost, members } = profile; - const onFormFinish = async (data: { teamName: string } | { devpost: string }, mutate: ScopedMutator) => { + const onFormFinish = async (data: { teamName: string } | { devpost: string }, mutate: ScopedMutator) => { const success = await handleSubmit(data, mutate); if (success) { notification['success']({ diff --git a/components/hacker/TeamSetup.tsx b/components/hacker/TeamSetup.tsx index e39eeeaa..8454ac5d 100644 --- a/components/hacker/TeamSetup.tsx +++ b/components/hacker/TeamSetup.tsx @@ -1,12 +1,12 @@ import { Col, Divider, Row } from 'antd'; import { Content } from 'antd/lib/layout/layout'; import { useSWRConfig } from 'swr'; -import { ScopedMutator } from 'swr/dist/types'; import { handleSubmitFailure } from '../../lib/helpers'; import { NewTeamFields } from '../../types/client'; -import TeamCard from '../TeamCard'; +import TeamCard from './TeamCard'; +import { ScopedMutator } from 'swr/dist/types'; -async function handleSubmit(formData: NewTeamFields | { joinCode: string }, mutate: ScopedMutator) { +async function handleSubmit(formData: NewTeamFields | { joinCode: string }, mutate: ScopedMutator) { const res = await fetch('/api/team-management', { method: 'POST', headers: { diff --git a/components/schedule.tsx b/components/judges/schedule.tsx similarity index 97% rename from components/schedule.tsx rename to components/judges/schedule.tsx index 04c19a58..e3c42428 100644 --- a/components/schedule.tsx +++ b/components/judges/schedule.tsx @@ -2,9 +2,9 @@ import { Space, Table, Collapse, Tag, Switch, Button, notification, Upload, Spin import React, { Dispatch, SetStateAction, useMemo, useState } from 'react'; import { DateTime } from 'luxon'; import Link from 'next/link'; -import { OrganizerScheduleDisplay, ScheduleDisplay } from '../types/client'; +import { OrganizerScheduleDisplay, ScheduleDisplay } from '../../types/client'; import { UploadOutlined } from '@ant-design/icons'; -import { JudgingSessionData } from '../types/database'; +import { JudgingSessionData } from '../../types/database'; import { User } from 'next-auth'; import Title from 'antd/lib/skeleton/Title'; @@ -89,7 +89,6 @@ export function generateTimes(start: Date, end: Date, interval: number) { const times = []; let current = start; while (current < end) { - console.log(current); times.push(current); current = new Date(current.getTime() + interval * 60000); } diff --git a/pages/JudgeDash.tsx b/pages/JudgeDash.tsx index a3000d6d..5ef4605d 100644 --- a/pages/JudgeDash.tsx +++ b/pages/JudgeDash.tsx @@ -1,13 +1,13 @@ import { Button, Divider, notification, Skeleton } from 'antd'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import useSWR, { useSWRConfig } from 'swr'; -import { ScopedMutator } from 'swr/dist/types'; import JudgingForm from '../components/judges/JudgingForm'; -import { JudgeSchedule } from '../components/schedule'; +import { JudgeSchedule } from '../components/judges/schedule'; import TeamSelect from '../components/judges/TeamSelect'; import { JudgingFormFields, ScheduleDisplay, TeamSelectData } from '../types/client'; import { JudgingSessionData, ResponseError, TeamData } from '../types/database'; import { signOut, useSession } from 'next-auth/react'; +import { ScopedMutator } from 'swr/dist/types'; const GENERIC_ERROR_MESSAGE = 'Oops, something went wrong!'; const GENERIC_ERROR_DESCRIPTION = 'Please try again or contact an organizer if the problem persists.'; @@ -35,7 +35,7 @@ function handleSubmitFailure(errorDescription: string) { async function handleSubmit( formData: JudgingFormFields, - mutate: ScopedMutator, + mutate: ScopedMutator, teamId: string, isNewForm: boolean, setIsNewForm: React.Dispatch> @@ -81,7 +81,7 @@ export default function JudgeDash() { // Get data for form component, formData will be false if teamId is not yet set. const { data: formData, error: formError } = useSWR( () => (teamID ? ['/api/judging-form', teamID] : null), - async (url, id) => { + async (url: any, id: any) => { const res = await fetch(`${url}?id=${id}`, { method: 'GET' }); if (!res.ok) { if (res.status === 404) { diff --git a/pages/Organizer/OrganizerDash.tsx b/pages/Organizer/OrganizerDash.tsx deleted file mode 100644 index f2360dcd..00000000 --- a/pages/Organizer/OrganizerDash.tsx +++ /dev/null @@ -1,314 +0,0 @@ -import { Button, Divider, Empty, Skeleton, Space, Tabs } from 'antd'; -import useSWR, { useSWRConfig } from 'swr'; -import AllScores from '../../components/allScores'; -import ManageRoleForm from '../../components/manageRoleForm'; -import OrganizerSchedule from '../../components/schedule'; -import PreAddForm from '../../components/preAddForm'; -import { ResponseError, ScoreData, TeamData, UserData, PreAddData, JudgingSessionData } from '../../types/database'; -import PreAddDisplay from '../../components/preAddDisplay'; -import ApplicantsDisplay from '../../components/applicantsDisplay'; -import Events from '../../components/events'; -import { signOut, useSession } from 'next-auth/react'; -import { SetStateAction, useEffect, useState } from 'react'; -import Title from 'antd/lib/typography/Title'; -import { - generateScheduleA, - generateScheduleB, - handleManageFormSubmit, - handlePreAddDelete, - TIMES_JUDGED, -} from '../../utils/organizer-utils'; - -export default function OrganizerDash() { - const { mutate } = useSWRConfig(); - - // Get teams data from API - const { data: teamsData, error: teamsError } = useSWR('/api/teams', async url => { - const res = await fetch(url, { method: 'GET' }); - if (!res.ok) { - const error = new Error('Failed to get list of teams.') as ResponseError; - error.status = res.status; - throw error; - } - return (await res.json()) as TeamData[]; - }); - - // Get scores data from API - const { data: scoresData, error: scoresError } = useSWR('/api/scores', async url => { - const res = await fetch(url, { method: 'GET' }); - if (!res.ok) { - const error = new Error('Failed to get list of scores.') as ResponseError; - error.status = res.status; - throw error; - } - return (await res.json()) as ScoreData[]; - }); - - // Get judges data from API - const { data: judgeData, error: judgeError } = useSWR('/api/users?usertype=JUDGE', async url => { - const res = await fetch(url, { method: 'GET' }); - if (!res.ok) { - const error = new Error('Failed to get list of judges.') as ResponseError; - error.status = res.status; - throw error; - } - return (await res.json()) as UserData[]; - }); - - // Get hackers data from API - const { data: hackers, error: hackersError } = useSWR('/api/users?usertype=HACKER', async url => { - const res = await fetch(url, { method: 'GET' }); - if (!res.ok) { - const error = new Error('Failed to get list of hackers.') as ResponseError; - error.status = res.status; - throw error; - } - return (await res.json()) as UserData[]; - }); - - /*const { data: scheduleData, error: scheduleError } = useSWR('/api/schedule', async url => { - const res = await fetch(url, { method: 'GET' }); - if (!res.ok) { - const error = new Error('Failed to get schedule.') as ResponseError; - error.status = res.status; - throw error; - } - return (await res.json()) as ScheduleDisplay[]; - });*/ - - // Get judging sessions data from API - const { data: judgingSessionsData, error: judgingSessionsDataError } = useSWR( - '/api/judging-sessions', - async url => { - const res = await fetch(url, { method: 'GET' }); - if (!res.ok) { - const error = new Error('Failed to get judging sessions') as ResponseError; - error.status = res.status; - throw error; - } - return (await res.json()) as JudgingSessionData[]; - } - ); - - // Get preadd data from API - const { data: preAddData, error: Error } = useSWR('/api/preadd', async url => { - const res = await fetch(url, { method: 'GET' }); - if (!res.ok) { - const error = new Error('Failed to get schedule.') as ResponseError; - error.status = res.status; - throw error; - } - return (await res.json()) as PreAddData[]; - }); - - // Get all users roles from API - const { data: userData, error } = useSWR('/api/manage-role', async url => { - const res = await fetch(url, { method: 'GET' }); - if (!res.ok) { - const error = new Error('Failed to get list of all users.') as ResponseError; - error.status = res.status; - throw error; - } - - return (await res.json()) as { _id: string; name: string; email: string; userType: string }[]; - }); - - useEffect(() => { - // Exit early if we don't have data yet - if (!judgingSessionsData) return; - - // Sort judging sessions by time - const time = new Date('2022-10-23T11:00:00').getTime(); - const sampleScheduleA = judgingSessionsData.filter( - judgingSession => new Date(judgingSession.time as string).getTime() < time - ); - const sampleScheduleB = judgingSessionsData.filter( - judgingSession => new Date(judgingSession.time as string).getTime() >= time - ); - - // Set the data - setSampleScheduleA(sampleScheduleA); - setSampleScheduleB(sampleScheduleB); - }, [judgingSessionsData]); - - // Check if schedule is impossible - const isScheduleImpossible = () => - teamsData && judgeData && (teamsData.length * TIMES_JUDGED) / 12 > judgeData.length; - - // Get session data - const { data: session, status } = useSession(); - - // React state - const [testingSchedule, setTestingSchedule] = useState(false); - const [sampleScheduleAData, setSampleScheduleA] = useState(undefined); - const [sampleScheduleBData, setSampleScheduleB] = useState(undefined); - - function handleConfirmSchedule(arg0: JudgingSessionData[]) { - throw new Error('Function not implemented.'); - } - - return ( - <> -
- -
Signed in as {session?.user?.email}
-
- - - {teamsData && - judgeData && - (testingSchedule ? ( - - ) : ( - - ))} - {!judgingSessionsData && } -
- - <> - {isScheduleImpossible() ? ( -
oops woopsy, something went fucky wucky
- ) : ( -
schedule is possible!!
- )} -
Count of Teams: {teamsData?.length}
-
Count of Judges: {judgeData?.length}
- - - {Expo A} - {sampleScheduleAData && ( - ): void { - throw new Error('Function not implemented.'); - }} - sessionTimeStart={new Date('2022-10-23T10:00:00')} - sessionTimeEnd={new Date('2022-10-23T11:00:00')} - /> - )} -
- {Expo B} - {sampleScheduleBData && ( - ): void { - throw new Error('Function not implemented.'); - }} - sessionTimeStart={new Date('2022-10-23T11:30:00')} - sessionTimeEnd={new Date('2022-10-23T12:30:00')} - /> - )} - - - ), - }, - { - label: `Judging`, - key: '2', - children: ( - <> - {!teamsData && } - {teamsData && ( - <> - {/* Add dropdown here w/ functionality */} - {judgeData && scoresData && ( - - )} - - )} - - ), - }, - { - label: `Manage Users`, - key: '3', - children: ( - <> - {!userData && } - {userData && userData.length == 0 && ( - No users lmao} - /> - )} - {userData && userData.length > 0 && ( - handleManageFormSubmit(formData, mutate)} - /> - )} - - ), - }, - { - label: `Pre-Add Users`, - key: '4', - children: ( - <> - {preAddData && preAddData.length == 0 && ( - No preadded users lmao} - /> - )} - {preAddData && preAddData.length > 0 && ( - handlePreAddDelete(user, mutate)} - /> - )} - - - ), - }, - { - label: `Manage Applications`, - key: '5', - children: <>{hackers && }, - }, - { - label: `Events`, - key: '6', - children: , - }, - ]} - /> - - - ); -} diff --git a/pages/OrganizerDash.tsx b/pages/OrganizerDash.tsx new file mode 100644 index 00000000..200e004a --- /dev/null +++ b/pages/OrganizerDash.tsx @@ -0,0 +1,61 @@ +import { Button, Space, Tabs } from 'antd'; +import { signOut, useSession } from 'next-auth/react'; +import ScheduleTab from '../components/Organizer/ScheduleTab/ScheduleTab'; +import JudgingTab from '../components/Organizer/JudgingTab/JudgingTab'; +import ManageUsersTab from '../components/Organizer/ManageUsersTab/ManageUsersTab'; +import PreAddUsersTab from '../components/Organizer/PreAddUsersTab/PreAddUsersTab'; +import ApplicantsTab from '../components/Organizer/ApplicantsTab/ApplicantsTab'; +import EventsTab from '../components/Organizer/EventsTab/EventsTab'; + +export default function OrganizerDash() { + // Get session data + const { data: session, status } = useSession(); + + return ( + <> +
+ +
Signed in as {session?.user?.email}
+
+ + , + }, + { + label: `Judging`, + key: '2', + children: , + }, + { + label: `Manage Users`, + key: '3', + children: , + }, + { + label: `Pre-Add Users`, + key: '4', + children: , + }, + { + label: `Manage Applications`, + key: '5', + children: , + }, + { + label: `Events`, + key: '6', + children: , + }, + ]} + /> + + + ); +} diff --git a/pages/api/preadd.ts b/pages/api/preadd.ts index 59e789c9..42f15f19 100644 --- a/pages/api/preadd.ts +++ b/pages/api/preadd.ts @@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from 'next'; import dbConnect from '../../middleware/database'; import { getSession } from 'next-auth/react'; import PreAdd from '../../models/preadd'; -import { PreAddFormFields } from '../../components/preAddForm'; +import { PreAddFormFields } from '../../components/Organizer/PreAddUsersTab/preAddForm'; import { MongoBulkWriteError, WriteError } from 'mongodb'; export default async function handler(req: NextApiRequest, res: NextApiResponse) { diff --git a/pages/index.tsx b/pages/index.tsx index 639984b7..9d955c21 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -5,7 +5,7 @@ import SignIn from '../components/signIn'; import { ApplicationStatus } from '../types/database'; import HackerDash from './HackerDash'; import JudgeDash from './JudgeDash'; -import OrganizerDash from './Organizer/OrganizerDash'; +import OrganizerDash from './OrganizerDash'; import Head from 'next/head'; export default function Page() { diff --git a/types/database.ts b/types/database.ts index fa76a15a..264549cf 100644 --- a/types/database.ts +++ b/types/database.ts @@ -103,6 +103,11 @@ export interface EventData { location: String; } +export interface EventCountData { + _id: mongoose.Schema.Types.ObjectId; + count: number; +} + export interface JudgingSessionData { _id?: mongoose.Schema.Types.ObjectId; team: TeamData; diff --git a/utils/organizer-utils.ts b/utils/organizer-utils.ts index 8f26a36d..1ac35b14 100644 --- a/utils/organizer-utils.ts +++ b/utils/organizer-utils.ts @@ -1,6 +1,6 @@ import { ScopedMutator } from 'swr/dist/types'; -import { ManageFormFields } from '../components/manageRoleForm'; -import { generateTimes } from '../components/schedule'; +import { ManageFormFields } from '../components/Organizer/ManageUsersTab/manageRoleForm'; +import { generateTimes } from '../components/judges/schedule'; import { handleSubmitSuccess, handleSubmitFailure } from '../lib/helpers'; import { JudgingSessionData, PreAddData, TeamData, UserData } from '../types/database'; @@ -47,7 +47,7 @@ export const generateScheduleB = (teams: TeamData[], judges: UserData[]) => { * @param {ManageFormFields} roleData - The form data for the role being managed. * @param {ScopedMutator} mutate - The scoped mutator function to update the query cache. */ -export const handleManageFormSubmit = async (roleData: ManageFormFields, mutate: ScopedMutator) => { +export const handleManageFormSubmit = async (roleData: ManageFormFields, mutate: ScopedMutator) => { const res = await fetch(`/api/manage-role`, { method: 'PATCH', headers: { @@ -69,7 +69,7 @@ export const handleManageFormSubmit = async (roleData: ManageFormFields, mutate: * @returns {void} * @throws {Error} If the deletion fails with an error response. */ -export const handlePreAddDelete = async (user: PreAddData, mutate: ScopedMutator) => { +export const handlePreAddDelete = async (user: PreAddData, mutate: ScopedMutator) => { console.log('logging user obj', user); const res = await fetch('/api/preadd', { method: 'DELETE', @@ -127,7 +127,7 @@ export const matchTeams = (teams: TeamData[], judges: UserData[], times: Date[]) * @param {JudgingSessionData[]} judgingSessions - The array of judging session data objects to submit. * @returns {void} */ -const handleConfirmSchedule = async (judgingSessions: JudgingSessionData[]) => { +export const handleConfirmSchedule = async (judgingSessions: JudgingSessionData[]) => { const res = await fetch('/api/confirm-judging-sessions', { method: 'POST', headers: { diff --git a/utils/request-utils.ts b/utils/request-utils.ts new file mode 100644 index 00000000..3db2fdcc --- /dev/null +++ b/utils/request-utils.ts @@ -0,0 +1,66 @@ +import useSWR from 'swr'; +import { ResponseError } from '../types/database'; +import { useEffect, useState } from 'react'; + +/** + * A custom hook that fetches data from the specified URL and returns the data, loading status, and error. + * Requires template type T to be specified. + * + * @param url - The URL to fetch data from. + * @param method - The HTTP method to use for the request. + * @param errorMessage - Optional error message to display if the request fails. + * @example + * ```tsx + * const { data, error, isLoading } = useCustomSWR({ + * url: '/api/teams', + * method: RequestType.GET, + * errorMessage: 'Failed to fetch teams.' + * }); + * ``` + */ +export const useCustomSWR = (params: CustomerSWRParams) => { + const [data, setData] = useState(null); + const [error, setError] = useState(null); + + const { data: requestData, error: requestError } = useSWR(params.url, async url => { + const res = await fetch(url, { method: params.method }); + if (!res.ok) { + const error = new Error( + params.errorMessage || 'An error occurred while fetching data from the server.' + ) as ResponseError; + error.status = res.status; + throw error; + } + return (await res.json()) as T[]; + }); + + useEffect(() => { + if (requestData) { + setData(requestData); + } + if (requestError) { + setError(requestError); + } + }, [requestData, requestError]); + + return { data, error }; +}; + +/* + * All possible HTTP request types + */ +export enum RequestType { + GET = 'GET', + POST = 'POST', + PUT = 'PUT', + DELETE = 'DELETE', +} + +/** + * Parameters for the useCustomSWR hook + */ +export interface CustomerSWRParams { + url: string; + method: RequestType; + errorMessage?: string; +} diff --git a/yarn.lock b/yarn.lock index 289c91f9..4b914d44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4088,4 +4088,4 @@ yallist@^4.0.0: yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== \ No newline at end of file