From d84b38e72a06120f0e104673b09080db8e72828a Mon Sep 17 00:00:00 2001 From: Pratyush Date: Fri, 15 Mar 2024 00:13:26 +0530 Subject: [PATCH] asdf --- app/api/event1/joinTeam/route.js | 2 +- app/events/event1/leaderDash/page.jsx | 4 +++- components/DeleteTeamButton.jsx | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 components/DeleteTeamButton.jsx diff --git a/app/api/event1/joinTeam/route.js b/app/api/event1/joinTeam/route.js index 738d754..c4351a6 100644 --- a/app/api/event1/joinTeam/route.js +++ b/app/api/event1/joinTeam/route.js @@ -59,7 +59,7 @@ export async function POST(req, { params }) { await Users.findOneAndUpdate( { _id: userId }, - { $set: { teamId: team.id, teamRole: 1 } } + { $set: { event1TeamId: team.id, event1TeamRole: 1 } } ); await Event1.findOneAndUpdate( diff --git a/app/events/event1/leaderDash/page.jsx b/app/events/event1/leaderDash/page.jsx index 0542df0..29530b2 100644 --- a/app/events/event1/leaderDash/page.jsx +++ b/app/events/event1/leaderDash/page.jsx @@ -9,6 +9,7 @@ import { useSession } from 'next-auth/react'; import { useRouter } from 'next/navigation'; import toast, { Toaster } from 'react-hot-toast'; import Link from 'next/link'; +import DeleteTeamButton from '@/components/DeleteTeamButton'; export default function LeaderDashboard() { const [popUpForDelete, setPopUpForDelete] = useState(false); @@ -237,7 +238,8 @@ export default function LeaderDashboard() { > Start Quiz */} - {/* deleteTeam()} /> */} + + deleteTeam()} /> {isQualified && (
diff --git a/components/DeleteTeamButton.jsx b/components/DeleteTeamButton.jsx new file mode 100644 index 0000000..2d330e1 --- /dev/null +++ b/components/DeleteTeamButton.jsx @@ -0,0 +1,14 @@ +import React from 'react'; + +const DeleteTeamButton = ({ onClick }) => { + return ( + + ); +}; + +export default DeleteTeamButton;