From dea786abbf6f4bb81adaf48d6bcc59a074cddbbd Mon Sep 17 00:00:00 2001 From: nathan-j-edwards Date: Sun, 28 Apr 2024 13:22:16 -0400 Subject: [PATCH] pr changes --- src/app/api/chapter/[chapterId]/route.ts | 13 +++++++++++++ src/components/AdminHomePage.tsx | 1 - src/components/ChapterRequest.tsx | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/app/api/chapter/[chapterId]/route.ts b/src/app/api/chapter/[chapterId]/route.ts index 8324fe48..100180b0 100644 --- a/src/app/api/chapter/[chapterId]/route.ts +++ b/src/app/api/chapter/[chapterId]/route.ts @@ -36,6 +36,19 @@ export const DELETE = withSessionAndRole(["ADMIN"], async ({ params }) => { ) ); + await prisma.user.updateMany({ + where: { + ChapterID: chapterId, + }, + data: { + SeniorIDs: { + set: [] + }, + position: "", + role: "USER" + } + }); + await prisma.chapterRequest.delete({ where: { id: chapter.chapterRequestId, diff --git a/src/components/AdminHomePage.tsx b/src/components/AdminHomePage.tsx index 37ef92dd..07195a43 100644 --- a/src/components/AdminHomePage.tsx +++ b/src/components/AdminHomePage.tsx @@ -19,7 +19,6 @@ type AdminHomePageProps = { }; const AdminHomePage = ({ chapters }: AdminHomePageProps) => { - const userContext = useContext(UserContext); const router = useRouter(); return ( diff --git a/src/components/ChapterRequest.tsx b/src/components/ChapterRequest.tsx index 7634aeee..9b9f167c 100644 --- a/src/components/ChapterRequest.tsx +++ b/src/components/ChapterRequest.tsx @@ -114,7 +114,7 @@ const ChapterRequest = (props: ChapterRequestProps) => { ) : (
- +
)}