방선주 방선주 2023-03-02
230302 방선주 사용자 상세 화면 진입 적용 중
@58750178aeaa7b43ccf8881e552536b43f1089da
 
client/views/component/Modal_Guadian.jsx (added)
+++ client/views/component/Modal_Guadian.jsx
@@ -0,0 +1,233 @@
+import React from "react";
+import Button from "./Button.jsx";
+import SubTitle from "./SubTitle.jsx";
+import Table from "./Table.jsx";
+import Pagination from "./Pagination.jsx";
+
+
+export default function Modal({ open, close, header, useseniorId }) {
+  const seniorId = useseniorId;
+  //대상자 - 보호자 매칭 리스트 
+  const [sgMatchList, setSgMatchList] = React.useState([]);
+  const [addGuadian, setAddGuadian] = React.useState(true); //추가된 보호자가 있는지 확인
+
+
+  //사용자 등록 초기값 설정
+  const [userName, setUserName] = React.useState("");
+  const [gender, setGender] = React.useState("");
+  const [brith, setBrith] = React.useState("");
+  const [telNum, setTelNum] = React.useState("");
+  const [homeAddress, setHomeAddress] = React.useState("");
+  const [relationship, setRelationship] = React.useState("");
+  const [matchState, setMatchState] = React.useState(true);
+
+  //-------- 페이징 작업 설정 시작 --------//
+  const limit = 5; // 페이지당 보여줄 공지 개수
+  const [page, setPage] = React.useState(1); //page index
+  const offset = (page - 1) * limit; //게시물 위치 계산
+  const [guadianTotal, setGuadianTotal] = React.useState(0); //최대길이 넣을 변수
+
+  //-------- 변경되는 데이터 Handler 설정 --------//
+  const handleUserName = (e) => {
+    setUserName(e.target.value);
+  };
+  const handleBrithday = (e) => {
+    setBrith(e.target.value);
+  };
+  const handleTelNum = (e) => {
+    e.target.value = e.target.value.replace(/[^0-9]/g, '').replace(/^(\d{2,3})(\d{3,4})(\d{4})$/, `$1-$2-$3`);
+    setTelNum(e.target.value);
+  };
+  const handelRelationship = (e) => {
+    setRelationship(e.target.value);
+  };
+  // 데이터 초기화 함수
+  const dataReset = () => {
+    setUserName("");
+    setBrith("");
+    setTelNum("");
+    setRelationship("");
+  }
+  // 매칭 리스트 출력 영역
+  const getselectMatchList = () => {
+    fetch("/user/selectSeniorGuardianMatch.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({
+        senior_id: seniorId,
+      }),
+    }).then((response) => response.json()).then((data) => {
+      console.log("getselectMatchList : ", data);
+      setSgMatchList(data);
+      setGuadianTotal(data.length);
+      setAddGuadian(false);
+    }).catch((error) => {
+      console.log('getselectMatchList() /user/selectSeniorGuardianMatch.json error : ', error);
+    });
+  };
+  // 보호자 등록 영역
+  const test = () => {
+    console.log("userName : ", userName);
+    console.log("gender : ", gender);
+    console.log("brith : ", brith);
+    console.log("telNum : ", telNum);
+    console.log("homeAddress : ", homeAddress);
+    console.log("relationship : ", relationship);
+    console.log("matchState : ", matchState);
+  }
+  const insertUser = () => {
+    fetch("/user/insertSeniorData.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({
+        user_name: userName,
+        user_gender: gender != "" ? gender : null,
+        user_birth: brith,
+        user_phonenumber: telNum,
+        user_address: homeAddress != "" ? homeAddress : null,
+        agency_id: 'agency01',
+        government_id: 'government01',
+        user_code: '3',
+
+      }),
+    }).then((response) => response.json()).then((data) => {
+      console.log("보호자 등록");
+      insertGuadian();
+    }).catch((error) => {
+      console.log('insertUser() /user/insertSeniorData.json error : ', error);
+    });
+  };
+
+  const insertGuadian = () => {
+    fetch("/user/insertGuardian.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({
+        user_phonenumber: telNum,
+      }),
+    }).then((response) => response.json()).then((data) => {
+      console.log("보호자 테이블 데이터 등록");
+      matchSeniorGuadian();
+    }).catch((error) => {
+      console.log('insertGuadian() /user/insertGuardian.json error : ', error);
+    });
+  };
+
+  const matchSeniorGuadian = () => {
+    fetch("/user/insertSeniorGuardianMatch.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({
+        senior_id: useseniorId,
+        user_phonenumber: telNum,
+        senior_relationship: relationship,
+        guardian_match_state: matchState,
+      }),
+    }).then((response) => response.json()).then((data) => {
+      console.log("매칭 등록");
+      dataReset();
+      setAddGuadian(true);
+    }).catch((error) => {
+      console.log('matchSeniorGuadian() /user/insertSeniorGuardianMatch.json error : ', error);
+    });
+  };
+
+  // 보호자 등록페이지 데이터
+  const thead3 = [
+    "No",
+    "이름",
+    "생년월일",
+    "연락처",
+    "대상자와의 관계",
+    "삭제"
+  ];
+  const key3 = [
+    "rn",
+    "guardian_name",
+    "user_birth",
+    "user_phonenumber",
+    "senior_relationship",
+  ];
+
+  React.useEffect(() => {
+    getselectMatchList();
+  }, [addGuadian])
+
+  return (
+    <div class={open ? "openModal modal" : "modal"}>
+      {open ? (
+        <div className="modal-inner">
+          <div className="modal-header flex">
+            {header}
+            <Button className={"close"} onClick={close} btnName={"X"} />
+          </div>
+          <div className="modal-main">
+            <div className="board-wrap">
+              <SubTitle explanation={"최초 ID는 연락처, PW는 생년월일 8자리입니다."} className="margin-bottom" />
+              <table className="margin-bottom2 senior-insert">
+                <tr>
+                  <th>이름</th>
+                  <td>
+                    <input type="text" value={userName} onChange={handleUserName} />
+                  </td>
+                  <th>생년월일</th>
+                  <td>
+                    <div className="flex">
+                      <input type='date' value={brith} onChange={handleBrithday} />
+                    </div>
+                  </td>
+                </tr>
+                <tr>
+                  <th>연락처</th>
+                  <td colSpan={3}>
+                    <input type="input" maxLength="13" value={telNum} onChange={handleTelNum} />
+                  </td>
+                </tr>
+                <tr>
+                  <th>대상자와의 관계</th>
+                  <td colSpan={3}>
+                    <input type="text" value={relationship} onChange={handelRelationship} />
+                  </td>
+                </tr>
+              </table>
+              <div className="btn-wrap flex-center margin-bottom5">
+                <Button
+                  className={"btn-small green-btn"}
+                  btnName={"추가"}
+                  onClick={() => {
+                    test();
+                    insertUser()
+                    getselectMatchList();
+                  }}
+                />
+              </div>
+              <div>
+                <Table
+                  className={"caregiver-user"}
+                  head={thead3}
+                  contents={sgMatchList}
+                  contentKey={key3}
+                  view={"guadianMatch"}
+                  offset={offset}
+                  limit={limit}
+                />
+              </div>
+              <div>
+                <Pagination total={guadianTotal} limit={limit} page={page} setPage={setPage} />
+              </div>
+            </div>
+          </div>
+        </div>
+      ) : null}
+    </div>
+
+  );
+}
client/views/component/Modal_Matching.jsx (Renamed from client/views/component/MatchingModal.jsx)
--- client/views/component/MatchingModal.jsx
+++ client/views/component/Modal_Matching.jsx
@@ -52,7 +52,7 @@
             {header}
             <Button className={"close"} onClick={close} btnName={"X"} />
           </div>
-          <div className="modal-main">{children}
+          <div className="modal-main">
             <div className="board-wrap">
               <SubTitle explanation={"담당자 선택"} className="margin-bottom" />
               <div className="flex-start protectorlist margin-bottom5">
client/views/component/Table.jsx
--- client/views/component/Table.jsx
+++ client/views/component/Table.jsx
@@ -1,10 +1,8 @@
 import React from "react";
 import Button from "./Button.jsx";
-import Modal from "./MatchingModal.jsx";
-import Modal2 from "./Modal.jsx";
-import SubTitle from "./SubTitle.jsx";
+import Modal_Matching from "./Modal_Matching.jsx";
+import Modal_Guadian from "./Modal_Guadian.jsx";
 import { useNavigate } from "react-router";
-import TableTest from "./TableTest.jsx";
 import { Link } from 'react-router-dom';
 // import styled from "styled-components";
 
@@ -14,41 +12,6 @@
   const [useName, setUseUserName] = React.useState("");
   // 매칭을 위해 대상자 ID 값 전달을 위함
   const [useseniorId, setUseSeniorId] = React.useState("");
-
-  //대상자 - 보호자 매칭 리스트 
-  const [sgMatchList, setSgMatchList] = React.useState([]);
-  
-  //사용자 등록 초기값 설정
-  const [userName, setUserName] = React.useState("");
-  const [gender, setGender] = React.useState("");
-  const [brith, setBrith] = React.useState("");
-  const [telNum, setTelNum] = React.useState("");
-  const [homeAddress, setHomeAddress] = React.useState("");
-  const [relationship, setRelationship] = React.useState("");
-  const [matchState, setMatchState] = React.useState(true);
-
-  //-------- 변경되는 데이터 Handler 설정 --------//
-  const handleUserName = (e) => {
-    setUserName(e.target.value);
-  };
-  const handleBrithday = (e) => {
-    setBrith(e.target.value);
-  };
-  const handleTelNum = (e) => {
-    e.target.value = e.target.value.replace(/[^0-9]/g, '').replace(/^(\d{2,3})(\d{3,4})(\d{4})$/, `$1-$2-$3`);
-    setTelNum(e.target.value);
-  };
-  const handelRelationship = (e) => {
-    setRelationship(e.target.value);
-  };
-  
-
-  const dataReset = () => {
-    setUserName("");
-    setBrith("");
-    setTelNum("");
-    relationship("")
-  }
 
   const [modalOpen, setModalOpen] = React.useState(false);
   const openModal = () => {
@@ -67,111 +30,6 @@
   const closeModal2 = () => {
     setModalOpen2(false);
   };
-  // 매칭 리스트 출력 영역
-  const getselectMatchList = () => {
-    fetch("/user/selectSeniorGuardianMatch.json", {
-      method: "POST",
-      headers: {
-        'Content-Type': 'application/json; charset=UTF-8'
-      },
-      body: JSON.stringify({
-        senior_id: useseniorId,
-      }),
-    }).then((response) => response.json()).then((data) => {
-      console.log("getselectMatchList : ", data);
-      setSgMatchList(data);
-      openModal();
-    }).catch((error) => {
-      console.log('getselectMatchList() /user/selectSeniorGuardianMatch.json error : ', error);
-    });
-  };
- // 보호자 등록 영역
- const test = () => {
-  console.log("userName : ", userName);
-  console.log("gender : ", gender);
-  console.log("brith : ", brith);
-  console.log("telNum : ", telNum);
-  console.log("homeAddress : ", homeAddress);
-  console.log("relationship : ", relationship);
-  console.log("matchState : ", matchState);
- }
-  const insertUser = () => {
-    fetch("/user/insertSeniorData.json", {
-      method: "POST",
-      headers: {
-        'Content-Type': 'application/json; charset=UTF-8'
-      },
-      body: JSON.stringify({
-        user_name: userName,
-        user_gender: gender != "" ? gender:null,
-        user_birth: brith,
-        user_phonenumber: telNum,
-        user_address: homeAddress != "" ? homeAddress:null,
-        agency_id: 'agency01',
-        government_id: 'government01',
-        user_code: '3',
-        
-      }),
-    }).then((response) => response.json()).then((data) => {
-      console.log("보호자 등록");
-      insertGuadian();
-    }).catch((error) => {
-      console.log('insertUser() /user/insertSeniorData.json error : ', error);
-    });
-  };
-
-  const insertGuadian = () => {
-    fetch("/user/insertGuardian.json", {
-      method: "POST",
-      headers: {
-        'Content-Type': 'application/json; charset=UTF-8'
-      },
-      body: JSON.stringify({
-        user_phonenumber: telNum,
-      }),
-    }).then((response) => response.json()).then((data) => {
-      console.log("보호자 테이블 데이터 등록");
-      matchSeniorGuadian();
-    }).catch((error) => {
-      console.log('insertGuadian() /user/insertGuardian.json error : ', error);
-    });
-  };
-
-  const matchSeniorGuadian = () => {
-    fetch("/user/insertSeniorGuardianMatch.json", {
-      method: "POST",
-      headers: {
-        'Content-Type': 'application/json; charset=UTF-8'
-      },
-      body: JSON.stringify({
-        senior_id:useseniorId,
-        user_phonenumber: telNum,
-        senior_relationship:relationship,
-        guardian_match_state:matchState,
-      }),
-    }).then((response) => response.json()).then((data) => {
-      console.log("매칭 등록");
-      dataReset();
-    }).catch((error) => {
-      console.log('matchSeniorGuadian() /user/insertSeniorGuardianMatch.json error : ', error);
-    });
-  };
-
-  // 보호자 등록페이지 데이터
-  const thead3 = [
-    "No",
-    "이름",
-    "생년월일",
-    "연락처",
-    "대상자와의 관계",
-  ];
-  const key3 = [
-    "rn",
-    "guardian_name",
-    "user_birth",
-    "user_phonenumber",
-    "senior_relationship",
-  ];
   
   const buttonPrint = (name, id) => {
     if (view == 'mySenior') {
@@ -183,7 +41,7 @@
             onClick={() =>{
               setUseUserName(name);
               setUseSeniorId(id);
-              getselectMatchList();
+              openModal();
               }}
           />
         </td>)
@@ -205,70 +63,31 @@
               onClick={(e) =>{
               setUseUserName(name);
               setUseSeniorId(id);
-              getselectMatchList();
+              openModal();
               }}
           />
           </td>
         </>
       )
+    } else {
+        return(
+    <td>
+      <Button
+        className={"btn-small gray-btn"}
+        btnName={"삭제"}
+        onClick={()=>{alert("삭제만들거예여.");}}
+      />
+    </td>
+    )
     }
   }
-  React.useEffect(() => {
-  }, [])
+
   return (
     <>
-      <Modal open={modalOpen2} close={closeModal2} header="담당자 배정" />
+      {/* 담당자 보기 모달 */}
+      <Modal_Matching open={modalOpen2} close={closeModal2} header="담당자 배정" />
       {/* 보호자 보기 모달창  */}
-      <Modal2 open={modalOpen} close={closeModal} header={useName+"님의 가족"} >
-        <div className="board-wrap">
-          <SubTitle explanation={"최초 ID는 연락처, PW는 생년월일 8자리입니다."} className="margin-bottom" />
-          <table className="margin-bottom2 senior-insert">
-            <tr>
-              <th>이름</th>
-              <td>
-                <input type="text" value={userName} onChange={handleUserName} />
-              </td>
-              <th>생년월일</th>
-              <td>
-                <div className="flex">
-                    <input type='date' value={brith} onChange={handleBrithday} />
-                </div>
-              </td>
-            </tr>
-            <tr>
-              <th>연락처</th>
-              <td colSpan={3}>
-                <input type="input" maxLength="13"  value={telNum} onChange={handleTelNum} />
-              </td>
-            </tr>
-            <tr>
-              <th>대상자와의 관계</th>
-              <td colSpan={3}>
-                <input type="text" value={relationship} onChange={handelRelationship}/>
-              </td>
-            </tr>
-          </table>
-          <div className="btn-wrap flex-center margin-bottom5">
-            <Button
-              className={"btn-small green-btn"}
-              btnName={"추가"}
-              onClick={() => {
-                test();
-                insertUser()
-                getselectMatchList();
-              }}
-            />
-          </div>
-          <div>
-            <TableTest
-              className={"caregiver-user"}
-              head={thead3}
-              contents={sgMatchList}
-              contentKey={key3}
-            />
-          </div>
-        </div>
-      </Modal2>
+      {modalOpen ? <Modal_Guadian open={modalOpen} close={closeModal} header={useName+"님의 가족"} useseniorId={useseniorId}/> : null}
       <table className={className}>
         <thead>
           <tr>
client/views/component/TableTest.jsx
--- client/views/component/TableTest.jsx
+++ client/views/component/TableTest.jsx
@@ -1,6 +1,6 @@
 import React from "react";
 import Button from "./Button.jsx";
-import Modal from "./MatchingModal.jsx";
+import Modal from "./Modal_Matching.jsx";
 import Modal2 from "./Modal.jsx";
 import SubTitle from "./SubTitle.jsx";
 import { useNavigate } from "react-router";
client/views/pages/AppRoute.jsx
--- client/views/pages/AppRoute.jsx
+++ client/views/pages/AppRoute.jsx
@@ -267,7 +267,7 @@
       <Route path="/Main_agency" element={<Main_agency />}></Route>
       <Route path="/UserAuthoriySelect_agency" element={<UserAuthoriySelect_agency />}></Route>
       <Route path="/SeniorInsert" element={<SeniorInsert />}></Route>
-      <Route path="/SeniorSelectOne" element={<SeniorSelectOne />}></Route>      
+      <Route path="/SeniorSelectOne/:seniorId" element={<SeniorSelectOne />}></Route>      
       <Route
         path="/MedicineCareSelectOne"
         element={<MedicineCareSelectOne />}
client/views/pages/senior_management/SeniorInsert.jsx
--- client/views/pages/senior_management/SeniorInsert.jsx
+++ client/views/pages/senior_management/SeniorInsert.jsx
@@ -3,26 +3,27 @@
 import ContentTitle from "../../component/ContentTitle.jsx";
 import { useNavigate } from "react-router";
 import SubTitle from "../../component/SubTitle.jsx";
+import { useLocation } from 'react-router-dom';
 
 export default function SeniorInsert() {
+  const seniorInfo = useLocation();
+  console.log(seniorInfo);
+
   const navigate = useNavigate();
 
   //초기값 세팅
-  const [regiNumber, setRegiNumber] = React.useState("");
   const [userName, setUserName] = React.useState("");
   const [gender, setGender] = React.useState("");
-  const [brithday, setBrithday] = React.useState("");
+  const [brith, setBrith] = React.useState("");
   const [telNum, setTelNum] = React.useState("");
   const [homeAddress, setHomeAddress] = React.useState("");
   const [medicineM, setMedicineM] = React.useState(false);
   const [medicineL, setMedicineL] = React.useState(false);
   const [medicineD, setMedicineD] = React.useState(false);
+  const [medication, setMedication] = React.useState("");
   const [note, setNote] = React.useState("");
 
-  // 변경되는 데이터 Handler
-  const handleRegiNumber = (e) => {
-    setRegiNumber(e.target.value);
-  };
+  //-------- 변경되는 데이터 Handler 설정 --------//
   const handleUserName = (e) => {
     setUserName(e.target.value);
   };
@@ -30,9 +31,10 @@
     setGender(e.target.value);
   };
   const handleBrithday = (e) => {
-    setBrithday(e.target.value);
+    setBrith(e.target.value);
   };
   const handleTelNum = (e) => {
+    e.target.value = e.target.value.replace(/[^0-9]/g, '').replace(/^(\d{2,3})(\d{3,4})(\d{4})$/, `$1-$2-$3`);
     setTelNum(e.target.value);
   };
   const handleHomeAddress = (e) => {
@@ -47,14 +49,25 @@
   const handleMedicineD = (e) => {
     setMedicineD(e.target.checked);
   };
+  const handleMedication = (e) => {
+    setMedication(e.target.value);
+  };
   const handleNote = (e) => {
     setNote(e.target.value);
+  };
+  const handleSelectUserCode = (e) => {
+    console.log("e.target.value : ", e.target.value)
+    setSelectUserCode(e.target.value);
+  };
+  const handleSelectUserData = (e) => {
+    console.log("e.target.value : ", e.target.value)
+    setSelectUserData(e.target.value);
   };
 
   const seniorInsert = () => {
     console.log("userName : ", userName);
     console.log("gender : ", gender);
-    console.log("brithday : ", brithday);
+    console.log("brith : ", brith);
     console.log("telNum : ", telNum);
     console.log("homeAddress : ", homeAddress);
     console.log("note : ", note);
@@ -80,11 +93,10 @@
     
   return (
     <main>
-      <div className="content-wrap row">
-        <ContentTitle contentTitle={"대상자 등록"} />
-        <SubTitle explanation={"회원 등록 시 ID는 연락처, 패스워드는 생년월일 8자리입니다."} className="margin-bottom"/>
+      <div className="board-wrap">
+          <SubTitle explanation={"회원 등록 시 ID는 연락처, 패스워드는 생년월일 8자리입니다."} className="margin-bottom" />
           <table className="margin-bottom2 senior-insert">
-          <tr>
+            {/* <tr>
               <th>대상자등록번호</th>
               <td colSpan={3} className="flex">
                 <input type="text" placeholder="생성하기 버튼 클릭 시 자동으로 생성됩니다."/>
@@ -93,7 +105,7 @@
               btnName={"생성하기"}
             />
               </td>
-            </tr>
+            </tr> */}
             <tr>
               <th>이름</th>
               <td>
@@ -112,22 +124,22 @@
               </td>
             </tr>
             <tr>
-            <th>생년월일</th>
+              <th>생년월일</th>
               <td>
                 <div className="flex">
-                  <input type='date' value={brithday} onChange={handleBrithday} />
+                  <input type='date' value={brith} onChange={handleBrithday} />
                 </div>
               </td>
               {/* <th>요양등급</th>
               <td>
               <input type="text" />
               </td> */}
-              
+
             </tr>
             <tr>
               <th>연락처</th>
               <td colSpan={3}>
-                <input type="text" value={telNum} onChange={handleTelNum}/>
+                <input type="text" maxLength="13" value={telNum} onChange={handleTelNum} />
               </td>
             </tr>
             <tr>
@@ -139,26 +151,27 @@
             <tr>
               <th>필요 복약</th>
               <td>
-              <div className="flex">
-                  <input type="checkbox" name="medicationSelect" checked={medicineM} onClick={(e) => {handleMedicineM(e)}} /><label for="medicationTime">아침</label>
-                  <input type="checkbox" name="medicationSelect" checked={medicineL} onClick={(e) => {handleMedicineL(e)}}/><label for="medicationTime">점심</label>
-                  <input type="checkbox" name="medicationSelect" checked={medicineD} onClick={(e) => {handleMedicineD(e)}}/><label for="medicationTime">저녁</label>
+                <div className="flex">
+                  <input type="checkbox" name="medicationSelect" checked={medicineM} onClick={(e) => { handleMedicineM(e) }} /><label for="medicationTime">아침</label>
+                  <input type="checkbox" name="medicationSelect" checked={medicineL} onClick={(e) => { handleMedicineL(e) }} /><label for="medicationTime">점심</label>
+                  <input type="checkbox" name="medicationSelect" checked={medicineD} onClick={(e) => { handleMedicineD(e) }} /><label for="medicationTime">저녁</label>
                 </div>
+              </td>
+            </tr>
+            <tr>
+              <th>복용중인 약</th>
+              <td colSpan={3}>
+                <textarea className="medicine" cols="30" rows="2" value={medication} onChange={handleMedication}></textarea>
               </td>
             </tr>
             <tr>
               <th>비고</th>
               <td colSpan={3}>
-                <textarea className="medicine" cols="30" rows="2" value={note} onChange={handleNote}></textarea>
+                <textarea className="note" cols="30" rows="2" value={note} onChange={handleNote}></textarea>
               </td>
             </tr>
+
             {/* <tr>
-              <th>복용중인 약</th>
-              <td colSpan={3}>
-                <textarea className="medicine" cols="30" rows="2"></textarea>
-              </td>
-            </tr>
-            <tr>
               <th>기저질환</th>
               <td colSpan={3}>
                 <textarea cols="30" rows="10"></textarea>
@@ -166,22 +179,21 @@
             </tr> */}
           </table>
           <div className="btn-wrap flex-center">
-            <Button
-              className={"btn-large gray-btn"}
+          <Button
+              className={"btn-small gray-btn"}
               btnName={"이전"}
-              onClick={() => {
-                navigate("/UserAuthoriySelect_admin");
+              onClick={() => {navigate(-1)
               }}
             />
             <Button
-              className={"btn-large green-btn"}
-              btnName={"등록"}
+              className={"btn-small gray-btn"}
+              btnName={"수정"}
               onClick={() => {
-                seniorInsert(userName,gender,brithday, telNum, homeAddress, note, medicineM, medicineL, medicineD)
+                InsertSenior(userName, gender, brith, telNum, homeAddress, note, medicineM, medicineL, medicineD)
               }}
             />
           </div>
-      </div>
+        </div>
     </main>
   );
 }
client/views/pages/senior_management/SeniorSelectOne.jsx
--- client/views/pages/senior_management/SeniorSelectOne.jsx
+++ client/views/pages/senior_management/SeniorSelectOne.jsx
@@ -3,9 +3,12 @@
 import { useNavigate } from "react-router";
 import ContentTitle from "../../component/ContentTitle.jsx";
 import PersonIcon from '@mui/icons-material/Person';
+import { useParams } from "react-router";
 
 export default function SeniorSelectOne() {
   const navigate = useNavigate();
+  let { seniorId } = useParams();
+  console.log("seniorId : ", seniorId);
   return (
     <main>
     <div className="content-wrap row">
@@ -74,7 +77,7 @@
             className={"btn-large green-btn"}
             btnName={"수정"}
             onClick={() => {
-              navigate("/UserAuthoriySelect_agency");
+              navigate("/Seniorinsert");
             }}
           />
         </div>
Add a comment
List