From c117e98e78f71045c786682feb93b230c28463bf Mon Sep 17 00:00:00 2001 From: kasterra Date: Sun, 2 Jun 2024 19:50:40 +0900 Subject: [PATCH] feat : prevent professor delete himself --- .../_procted+/lectures+/quiz+/edit/index.tsx | 7 ++-- app/routes/admin+/users/Table.tsx | 32 ++++++++++--------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/app/routes/_procted+/lectures+/quiz+/edit/index.tsx b/app/routes/_procted+/lectures+/quiz+/edit/index.tsx index b342476..483caf4 100644 --- a/app/routes/_procted+/lectures+/quiz+/edit/index.tsx +++ b/app/routes/_procted+/lectures+/quiz+/edit/index.tsx @@ -1,13 +1,10 @@ -import TextInput from "~/components/Input/TextInput"; import styles from "../index.module.css"; -import judgeStyles from "~/css/judge.module.css"; import inputStyles from "~/components/Input/input.module.css"; import formStyles from "~/components/common/form.module.css"; import { MetaFunction, useNavigate, useSearchParams } from "@remix-run/react"; -import { getUsersInLecture } from "~/API/lecture"; import { ReactNode, useEffect, useState } from "react"; import { useAuth } from "~/contexts/AuthContext"; -import { QuizData, UserEntity } from "~/types/APIResponse"; +import { QuizData } from "~/types/APIResponse"; import TableBase from "~/components/Table/TableBase"; import plusSquare from "~/assets/plus-square.svg"; import minusSquare from "~/assets/minus-square.svg"; @@ -16,7 +13,7 @@ import fileDownloadSVG from "~/assets/fileDownload.svg"; import { createQuizResultXlsx, parseQuizResultXlsx } from "~/util/xlsx"; import pkg from "file-saver"; import toast from "react-hot-toast"; -import { createNewQuiz, getAllQuizes, updateQuiz } from "~/API/practice"; +import { getAllQuizes, updateQuiz } from "~/API/practice"; import { safeParseInt } from "~/util"; import { extractStudentInfo, toTableData } from "~/util/quizUtil"; const { saveAs } = pkg; diff --git a/app/routes/admin+/users/Table.tsx b/app/routes/admin+/users/Table.tsx index 9be29c1..e26bc2e 100644 --- a/app/routes/admin+/users/Table.tsx +++ b/app/routes/admin+/users/Table.tsx @@ -88,21 +88,23 @@ const Table = () => { > 암호 초기화 - + {elem.role === "professor" ? null : ( + + )} , ], ])