Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 9 additions & 49 deletions src/components/outline/Display.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -137,6 +91,12 @@ const Display: React.FC = () => {
);
}, [searchParams, commitmentOptions, skillOptions, schoolOptions]);

useEffect(() => {
if (data) {
getInvites();
}
}, [data, getInvites]);

if (loading || userLoading || inviteLoading) return <LoadingScreen />;
// Display not registered screen if an unregistered non-member tries to access the portal
if (!data && !userData.roles.member) return <NotRegisteredErrorScreen />;
Expand Down