- {data?.map((item, index) => (
+ {AccpetMutate?.map((item, index) => (
handleAcceptListClick(item.user_id, item.username)}
+ onClick={() => handleAcceptListClick(item.id, item.user_name)}
prevClass={item.move}
nextClass={`${item.classroom_name}`}
student={getStudentString(item)}
diff --git a/src/app/outAccept/page.tsx b/src/app/outAccept/page.tsx
index 36a2a0b..1ecd4d9 100644
--- a/src/app/outAccept/page.tsx
+++ b/src/app/outAccept/page.tsx
@@ -127,7 +127,7 @@ const OutAccept = () => {
{
type: reqOption,
status: "NO",
- ids: selectedStudents,
+ id_list: selectedStudents,
},
{
onSuccess: () => {
@@ -155,7 +155,7 @@ const OutAccept = () => {
{
type: reqOption,
status: "OK",
- ids: selectedStudents,
+ id_list: selectedStudents,
},
{
onSuccess: () => {
@@ -221,7 +221,7 @@ const OutAccept = () => {
key={index}
returnTime={`${item.start}~${item.end}`}
name={getStudentString(item)}
- onClick={() => handleAcceptListClick(item.id, item.username)}
+ onClick={() => handleAcceptListClick(item.id, item.user_name)}
reason={item.reason}
/>
))
@@ -232,7 +232,7 @@ const OutAccept = () => {
key={index}
returnTime={`${item.start}~ `}
name={getStudentString(item)}
- onClick={() => handleAcceptListClick(item.id, item.username)}
+ onClick={() => handleAcceptListClick(item.id, item.user_name)}
reason={item.reason}
/>
))}
diff --git a/src/app/outList/page.tsx b/src/app/outList/page.tsx
index 4858e16..b5cbc64 100644
--- a/src/app/outList/page.tsx
+++ b/src/app/outList/page.tsx
@@ -93,7 +93,7 @@ const OutList = () => {
{data?.map((item, index) => (
{
- handleAcceptListClick(item.id, item.username);
+ handleAcceptListClick(item.id, item.user_name);
}}
id={item.id}
type="application"
diff --git a/src/components/input/auto.tsx b/src/components/input/auto.tsx
index 357aafb..4592a18 100644
--- a/src/components/input/auto.tsx
+++ b/src/components/input/auto.tsx
@@ -57,7 +57,9 @@ const AutoInput: React.FC = ({
}, [GetStudentMutate]);
useEffect(() => {
- const students = data?.map((item) => `${setStudentNum(item)} ${item.name}`);
+ const students = data?.map(
+ (item) => `${setStudentNum(item)} ${item.user_name}`
+ );
setStudent(students);
}, [data]);
diff --git a/src/util/util.ts b/src/util/util.ts
index 0f058f5..bc38245 100644
--- a/src/util/util.ts
+++ b/src/util/util.ts
@@ -10,7 +10,7 @@ interface Student {
grade: number;
class_num: number;
num: number;
- username: string;
+ user_name: string;
}
interface studentNum {
@@ -23,10 +23,10 @@ export const getStudentString = ({
grade,
class_num,
num,
- username,
+ user_name,
}: Student) => {
const change = num.toString().length === 1 ? `0${num}` : `${num}`;
- return `${grade}${class_num}${change} ${username}`;
+ return `${grade}${class_num}${change} ${user_name}`;
};
export const setStudentNum = ({ grade, class_num, num }: studentNum) => {
@@ -53,6 +53,6 @@ export const ChangeOut = (type: "APPLICATION" | "EARLY_RETURN") => {
};
enum a {
- APPLICATION="외출",
- EARLY_RETURN="조기귀가"
-}
\ No newline at end of file
+ APPLICATION = "외출",
+ EARLY_RETURN = "조기귀가",
+}