diff --git a/app/events/event1/leaderDash/page.jsx b/app/events/event1/leaderDash/page.jsx index 29530b2..46aec57 100644 --- a/app/events/event1/leaderDash/page.jsx +++ b/app/events/event1/leaderDash/page.jsx @@ -213,7 +213,7 @@ export default function LeaderDashboard() { name={el.name} Role={el.event1TeamRole === 0 ? 'Leader' : 'Member'} regNo={el.regNo} - phone={el.mobno} + phone={el.mobNo} leader={true} removeMember={() => { removeMember(el._id); diff --git a/app/events/event1/memberDash/page.jsx b/app/events/event1/memberDash/page.jsx index 3310118..565ea64 100644 --- a/app/events/event1/memberDash/page.jsx +++ b/app/events/event1/memberDash/page.jsx @@ -26,14 +26,12 @@ const TeamPage = () => { const router = useRouter(); useEffect(() => { - if (router.isReady) { - - if (status === "unauthenticated") { - router.push("/") - } else if(status === "authenticated"){ - getData() - fetchDataFromBackend(); - } + if (status === "unauthenticated") { + router.push("/") + } else if(status === "authenticated"){ + console.log('asdf') + getData() + fetchDataFromBackend(); } }, [status, router]) @@ -52,9 +50,10 @@ const TeamPage = () => { .then((data) => { const user = data.user; + console.log('user;;', user) if (user.hasFilledDetails == true) { if (user.event1TeamId !== null) { - // router.push("/"); + router.push("/"); if (user.event1TeamRole === '0') { router.push('/leaderDashboard') } else { @@ -72,7 +71,7 @@ const TeamPage = () => { const fetchDataFromBackend = () => { setIsLoading(true); - fetch('/team/getTeamData', { + fetch('/api/event1/getTeamData', { content: "application/json", method: "GET", headers: { @@ -98,7 +97,7 @@ const TeamPage = () => { const leaveTeam = () => { setIsLoading(true); - fetch( '/user/leaveTeam/'+teamId, { + fetch( '/api/event1/leaveTeam/'+teamId, { content: "application/json", method: "POST", headers: { @@ -138,7 +137,7 @@ const TeamPage = () => {
{ teamMembersData.map(el=>{ - return + return }) }