Showing
2 changed files
with
29 additions
and
4 deletions
... | @@ -22,6 +22,7 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { | ... | @@ -22,6 +22,7 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { |
22 | const [doctorDetail, setDoctorDetail] = useState<any>({}); | 22 | const [doctorDetail, setDoctorDetail] = useState<any>({}); |
23 | const [modalUp, setModalUp] = useState<boolean>(false); | 23 | const [modalUp, setModalUp] = useState<boolean>(false); |
24 | const [validate, setValidate] = useState<string>('W'); | 24 | const [validate, setValidate] = useState<string>('W'); |
25 | + const [validateDoctorLicense, setValidateDoctorLicense] = useState<string>(''); | ||
25 | 26 | ||
26 | 27 | ||
27 | 28 | ||
... | @@ -65,6 +66,11 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { | ... | @@ -65,6 +66,11 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { |
65 | licensePage.focus(); | 66 | licensePage.focus(); |
66 | }; | 67 | }; |
67 | 68 | ||
69 | + //자격 확인 문서를 보고, 면허 번호를 입력하는 함수 | ||
70 | + const onSetValidateDoctorLicense = (e : React.ChangeEvent<HTMLInputElement>) => { | ||
71 | + setValidateDoctorLicense(e.target.value); | ||
72 | + }; | ||
73 | + | ||
68 | //회원 가입 수락 | 74 | //회원 가입 수락 |
69 | const onAcceptRequest = () => { | 75 | const onAcceptRequest = () => { |
70 | if(validate === 'W') { | 76 | if(validate === 'W') { |
... | @@ -77,7 +83,10 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { | ... | @@ -77,7 +83,10 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { |
77 | 83 | ||
78 | const onAccept = async() => { | 84 | const onAccept = async() => { |
79 | try { | 85 | try { |
80 | - await managerApi.acceptDoctorRegReq(token, doctorDetail) | 86 | + await managerApi.acceptDoctorRegReq(token, { |
87 | + doctorId : doctorDetail.doctorId, | ||
88 | + validateDoctorLicense, | ||
89 | + }) | ||
81 | .then((res : any) => { | 90 | .then((res : any) => { |
82 | if(res.statusText === 'OK') { | 91 | if(res.statusText === 'OK') { |
83 | Alert.onSuccess('회원 등록이 완료되었습니다.', fetchData); | 92 | Alert.onSuccess('회원 등록이 완료되었습니다.', fetchData); |
... | @@ -95,7 +104,9 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { | ... | @@ -95,7 +104,9 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { |
95 | const onRejectRequest = () => { | 104 | const onRejectRequest = () => { |
96 | const onReject = async() => { | 105 | const onReject = async() => { |
97 | try { | 106 | try { |
98 | - await managerApi.rejectDoctorRegReq(token, doctorDetail) | 107 | + await managerApi.rejectDoctorRegReq(token, { |
108 | + doctorId : doctorDetail.doctorId, | ||
109 | + }) | ||
99 | .then((res : any) => { | 110 | .then((res : any) => { |
100 | if(res.statusText === 'OK') { | 111 | if(res.statusText === 'OK') { |
101 | Alert.onSuccess('회원 등록이 취소되었습니다.', fetchData); | 112 | Alert.onSuccess('회원 등록이 취소되었습니다.', fetchData); |
... | @@ -112,13 +123,13 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { | ... | @@ -112,13 +123,13 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { |
112 | const onValidate = async () => { | 123 | const onValidate = async () => { |
113 | try { | 124 | try { |
114 | await managerApi.validateDoctorLicense(token, { | 125 | await managerApi.validateDoctorLicense(token, { |
115 | - doctorLicense : doctorDetail.info.doctorLicense, | 126 | + validateDoctorLicense, |
116 | }).then(res => { | 127 | }).then(res => { |
117 | if(res.statusText === 'OK') { | 128 | if(res.statusText === 'OK') { |
118 | setValidate(res.data.result ? 'Y' : 'N'); | 129 | setValidate(res.data.result ? 'Y' : 'N'); |
119 | } | 130 | } |
120 | }).catch(err => { | 131 | }).catch(err => { |
121 | - Alert.onError(err.response.data, () => { | 132 | + Alert.onError(err.response.data.error, () => { |
122 | setModalUp(false); | 133 | setModalUp(false); |
123 | setValidate('W'); | 134 | setValidate('W'); |
124 | }); | 135 | }); |
... | @@ -131,6 +142,12 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { | ... | @@ -131,6 +142,12 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { |
131 | } | 142 | } |
132 | }; | 143 | }; |
133 | 144 | ||
145 | + | ||
146 | + useEffect(() => { | ||
147 | + setValidate('W'); | ||
148 | + setValidateDoctorLicense(''); | ||
149 | + }, [modalUp]); | ||
150 | + | ||
134 | useEffect(() => { | 151 | useEffect(() => { |
135 | fetchData(); | 152 | fetchData(); |
136 | }, []); | 153 | }, []); |
... | @@ -148,6 +165,9 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { | ... | @@ -148,6 +165,9 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => { |
148 | validate = {validate} | 165 | validate = {validate} |
149 | onValidate = {onValidate} | 166 | onValidate = {onValidate} |
150 | 167 | ||
168 | + validateDoctorLicense = {validateDoctorLicense} | ||
169 | + onSetValidateDoctorLicense = {onSetValidateDoctorLicense} | ||
170 | + | ||
151 | onAcceptRequest = {onAcceptRequest} | 171 | onAcceptRequest = {onAcceptRequest} |
152 | onRejectRequest = {onRejectRequest} | 172 | onRejectRequest = {onRejectRequest} |
153 | /> | 173 | /> | ... | ... |
... | @@ -16,6 +16,9 @@ interface ManagerMenuProps { | ... | @@ -16,6 +16,9 @@ interface ManagerMenuProps { |
16 | validate : string; | 16 | validate : string; |
17 | onValidate : () => void; | 17 | onValidate : () => void; |
18 | 18 | ||
19 | + validateDoctorLicense : string; | ||
20 | + onSetValidateDoctorLicense : React.ChangeEventHandler<HTMLInputElement>; | ||
21 | + | ||
19 | onAcceptRequest : () => void; | 22 | onAcceptRequest : () => void; |
20 | onRejectRequest : () => void; | 23 | onRejectRequest : () => void; |
21 | 24 | ||
... | @@ -50,6 +53,8 @@ const ManagerMenuPresenter = (props : ManagerMenuProps) => { | ... | @@ -50,6 +53,8 @@ const ManagerMenuPresenter = (props : ManagerMenuProps) => { |
50 | <styled.ModalInfo> | 53 | <styled.ModalInfo> |
51 | <styled.DoctorLicenseViewInput | 54 | <styled.DoctorLicenseViewInput |
52 | placeholder = '의사 면허 번호' | 55 | placeholder = '의사 면허 번호' |
56 | + value = {props.validateDoctorLicense} | ||
57 | + onChange = {props.onSetValidateDoctorLicense} | ||
53 | /> | 58 | /> |
54 | <styled.ValidateButton | 59 | <styled.ValidateButton |
55 | onClick = {props.onValidate} | 60 | onClick = {props.onValidate} | ... | ... |
-
Please register or login to post a comment