
--- client/views/component/Modal_SeniorInsert.jsx
+++ client/views/component/Modal_SeniorInsert.jsx
... | ... | @@ -64,27 +64,32 @@ |
64 | 64 |
//-------- 등록 버튼 동작 수행 영역 시작 --------// |
65 | 65 |
// 대상자 정보 등록을 위한 함수 |
66 | 66 |
const InsertUserData = () => { |
67 |
- fetch("/user/insertSeniorData.json", { |
|
68 |
- method: "POST", |
|
69 |
- headers: { |
|
70 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
71 |
- }, |
|
72 |
- body: JSON.stringify({ |
|
73 |
- user_name: userName, |
|
74 |
- user_gender: gender, |
|
75 |
- user_birth: brith, |
|
76 |
- user_phonenumber: telNum, |
|
77 |
- user_address: homeAddress, |
|
78 |
- agency_id: 'agency01', |
|
79 |
- government_id: 'government01', |
|
80 |
- user_code: '4', |
|
81 |
- }), |
|
82 |
- }).then((response) => response.json()).then((data) => { |
|
83 |
- console.log("대상자 정보 등록"); |
|
84 |
- InsertUserPillData(); |
|
85 |
- }).catch((error) => { |
|
86 |
- console.log('insertSeniorData() /user/insertSeniorData.json error : ', error); |
|
87 |
- }); |
|
67 |
+ var insertBtn = confirm("등록하시겠습니까?"); |
|
68 |
+ if (insertBtn) { |
|
69 |
+ fetch("/user/insertSeniorData.json", { |
|
70 |
+ method: "POST", |
|
71 |
+ headers: { |
|
72 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
73 |
+ }, |
|
74 |
+ body: JSON.stringify({ |
|
75 |
+ user_name: userName, |
|
76 |
+ user_gender: gender, |
|
77 |
+ user_birth: brith, |
|
78 |
+ user_phonenumber: telNum, |
|
79 |
+ user_address: homeAddress, |
|
80 |
+ agency_id: 'agency01', |
|
81 |
+ government_id: 'government01', |
|
82 |
+ user_code: '4', |
|
83 |
+ }), |
|
84 |
+ }).then((response) => response.json()).then((data) => { |
|
85 |
+ console.log("대상자 정보 등록"); |
|
86 |
+ InsertUserPillData(); |
|
87 |
+ }).catch((error) => { |
|
88 |
+ console.log('insertSeniorData() /user/insertSeniorData.json error : ', error); |
|
89 |
+ }); |
|
90 |
+ } else { |
|
91 |
+ return; |
|
92 |
+ } |
|
88 | 93 |
}; |
89 | 94 |
// 대상자 약 복용 정보 등록을 위한 함수 |
90 | 95 |
const InsertUserPillData = () => { |
... | ... | @@ -105,7 +110,9 @@ |
105 | 110 |
console.log("약 정보 등록"); |
106 | 111 |
dataReset(); |
107 | 112 |
setAddSenior(true) |
113 |
+ alert("등록 되었습니다."); |
|
108 | 114 |
noticeModalClose() |
115 |
+ |
|
109 | 116 |
}).catch((error) => { |
110 | 117 |
console.log('InsertUserPillData() /user/insertSeniorMadication.json error : ', error); |
111 | 118 |
}); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?