From f42e4c6289c9212c2f88f786bfb725561471c827 Mon Sep 17 00:00:00 2001 From: kasterra Date: Sun, 2 Jun 2024 19:57:25 +0900 Subject: [PATCH] feat : prevent professor delete himself --- .../_procted+/lectures+/quiz+/edit/index.tsx | 7 +--- .../_procted+/students+/$lectureId+/Table.tsx | 40 ++++++++++--------- 2 files changed, 23 insertions(+), 24 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/_procted+/students+/$lectureId+/Table.tsx b/app/routes/_procted+/students+/$lectureId+/Table.tsx index 09f01c6..dbd4532 100644 --- a/app/routes/_procted+/students+/$lectureId+/Table.tsx +++ b/app/routes/_procted+/students+/$lectureId+/Table.tsx @@ -277,25 +277,27 @@ const Table = () => { > 암호 초기화 - + {(elem as any).lecture_role === "professor" ? null : ( + + )} , ], ])