From a6bcc0464c8057e59330a95d2d1b8b54a1493779 Mon Sep 17 00:00:00 2001 From: kv8gh Date: Fri, 15 Mar 2024 18:47:40 +0530 Subject: [PATCH] add member button is working --- app/api/event1/createTeam/route.js | 2 +- app/api/event1/getTeamData/route.js | 4 +++- app/events/event1/page.jsx | 6 +++--- app/userDetails/page.jsx | 2 +- components/SignInBtn.jsx | 6 ++++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/api/event1/createTeam/route.js b/app/api/event1/createTeam/route.js index 6a8565a..e4a6c31 100644 --- a/app/api/event1/createTeam/route.js +++ b/app/api/event1/createTeam/route.js @@ -13,7 +13,7 @@ export async function POST(req) { const token = await getToken({ req }); const auth = token ? token.accessTokenFromBackend : null; let userId = await getTokenDetails(auth); - console.log('ddddddd', userId); + console.log('dddddddhhhhhhhhhhhhhhh', userId); const user = await Users.findById({ _id: userId }); diff --git a/app/api/event1/getTeamData/route.js b/app/api/event1/getTeamData/route.js index 9a901e7..e1a83f3 100644 --- a/app/api/event1/getTeamData/route.js +++ b/app/api/event1/getTeamData/route.js @@ -13,9 +13,10 @@ export async function GET(req) { const token = await getToken({ req }); const auth = token ? token.accessTokenFromBackend : null; let userId = await getTokenDetails(auth); - console.log('dddddd', userId); + console.log('uuuuuuuuuuuuuuuuuuuuuuuu', userId); const user = await Users.findById({ _id: userId }); + console.log('gggggggggggggggggggggggg',user); if (!user) { return NextResponse.json({ message: 'User Not found' }); @@ -24,6 +25,7 @@ export async function GET(req) { const teamId = user.event1TeamId; const team = await Event1.findById(teamId).populate('members'); + console.log(team) if (!team) { return NextResponse.json({ message: 'Team is not there ' }); } diff --git a/app/events/event1/page.jsx b/app/events/event1/page.jsx index 0a6c334..6db4ab2 100644 --- a/app/events/event1/page.jsx +++ b/app/events/event1/page.jsx @@ -1,3 +1,5 @@ +import Link from "next/link"; + export default function Page() { return
Event1 Landing Page @@ -5,8 +7,6 @@ export default function Page() { info about Event1

- + Register
; } \ No newline at end of file diff --git a/app/userDetails/page.jsx b/app/userDetails/page.jsx index 4469289..9a2e95c 100644 --- a/app/userDetails/page.jsx +++ b/app/userDetails/page.jsx @@ -152,7 +152,7 @@ export default function UserDetails() { style={{ color: "black" }} /> - + ); diff --git a/components/SignInBtn.jsx b/components/SignInBtn.jsx index 63eec2d..102d2eb 100644 --- a/components/SignInBtn.jsx +++ b/components/SignInBtn.jsx @@ -2,19 +2,21 @@ import Image from "next/image"; import { signIn,signOut,useSession } from "next-auth/react"; +import { Router, useRouter } from "next/navigation"; export default function SignInBtn() { const { status } = useSession(); + const router = useRouter(); return (
{status === "authenticated" ? ( ) : ( )}