Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
pratyush3124 committed Mar 14, 2024
1 parent 0e07df2 commit d84b38e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/api/event1/joinTeam/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion app/events/event1/leaderDash/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -237,7 +238,8 @@ export default function LeaderDashboard() {
>
Start Quiz
</button> */}
{/* <DeleteTeamButton onClick={() => deleteTeam()} /> */}

<DeleteTeamButton onClick={() => deleteTeam()} />

{isQualified && (
<div className="flex flex-col text-white items-center border p-2 rounded-xl my-2">
Expand Down
14 changes: 14 additions & 0 deletions components/DeleteTeamButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

const DeleteTeamButton = ({ onClick }) => {
return (
<button
onClick={onClick}
className="bg-red-500 text-white px-3 py-1 border-0 rounded-lg cursor-pointer"
>
Delete Team
</button>
);
};

export default DeleteTeamButton;

0 comments on commit d84b38e

Please sign in to comment.