diff --git a/src/components/outline/Display.tsx b/src/components/outline/Display.tsx index 52363c9..f868ea7 100644 --- a/src/components/outline/Display.tsx +++ b/src/components/outline/Display.tsx @@ -67,62 +67,16 @@ const Display: React.FC = () => { method: "GET", }); - const [{ data: inviteData, loading: inviteLoading }] = useAxios({ + const [{ data: inviteData, loading: inviteLoading }, getInvites] = useAxios({ url: apiUrl( Service.HEXATHONS, `/teams/get-invites?hexathon=${process.env.REACT_APP_HEXATHON_ID}` ), method: "GET", + }, { + manual: true, }); - // const teamRequests = [ - // { - // members: [], - // public: false, - // hexathon: "647fee51768e521dc8ef88e0", - // name: "Team A", - // sentInvites: [ - // { - // member: "65c7e7afe487b453d90d579c", - // message: "You are invited to join our team!", - // id: "65c80369a5a1e7bac212161d" - // }, - // { - // member: "65c7e716e487b453d90d5799", - // message: "You are invited to join our team!", - // id: "65c80369a5a1e7bac212161e" - // } - // ], - // memberRequests: [], - // id: "65c7e559e487b453d90d5794" - // }, - // { - // members: [], - // public: false, - // hexathon: "647fee51768e521dc8ef88e0", - // name: "Team C", - // sentInvites: [ - // { - // member: "65c7e753e487b453d90d579a", - // message: "Hi there", - // id: "65c80369a5a1e7bac212161f" - // }, - // { - // member: "65c7e786e487b453d90d579b", - // message: "Hello there", - // id: "65c80369a5a1e7bac2121620" - // }, - // { - // member: "65c7e7afe487b453d90d579c", - // message: "You are invited to join our team!", - // id: "65c80369a5a1e7bac2121621" - // } - // ], - // memberRequests: [], - // id: "65c7e5f7e487b453d90d5796" - // } - // ] - useEffect(() => { setCommitmentSelectValue( commitmentOptions.filter( @@ -137,6 +91,12 @@ const Display: React.FC = () => { ); }, [searchParams, commitmentOptions, skillOptions, schoolOptions]); + useEffect(() => { + if (data) { + getInvites(); + } + }, [data, getInvites]); + if (loading || userLoading || inviteLoading) return ; // Display not registered screen if an unregistered non-member tries to access the portal if (!data && !userData.roles.member) return ;