Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-09-19 00:07:13 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4358d998ed37e1e5c6d23bb9a65176a22b1181f3
4358d998
1 parent
7a4b5392
feat. 상세정보 뷰 api
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
web/src/views/main/manager/ManagerMenuContainer.tsx
web/src/views/main/manager/ManagerMenuPresenter.tsx
web/src/views/main/manager/ManagerMenuContainer.tsx
View file @
4358d99
...
...
@@ -22,6 +22,7 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
const [doctorDetail, setDoctorDetail] = useState<any>({});
const [modalUp, setModalUp] = useState<boolean>(false);
const [validate, setValidate] = useState<string>('W');
const [validateDoctorLicense, setValidateDoctorLicense] = useState<string>('');
...
...
@@ -65,6 +66,11 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
licensePage.focus();
};
//자격 확인 문서를 보고, 면허 번호를 입력하는 함수
const onSetValidateDoctorLicense = (e : React.ChangeEvent<HTMLInputElement>) => {
setValidateDoctorLicense(e.target.value);
};
//회원 가입 수락
const onAcceptRequest = () => {
if(validate === 'W') {
...
...
@@ -77,7 +83,10 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
const onAccept = async() => {
try {
await managerApi.acceptDoctorRegReq(token, doctorDetail)
await managerApi.acceptDoctorRegReq(token, {
doctorId : doctorDetail.doctorId,
validateDoctorLicense,
})
.then((res : any) => {
if(res.statusText === 'OK') {
Alert.onSuccess('회원 등록이 완료되었습니다.', fetchData);
...
...
@@ -95,7 +104,9 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
const onRejectRequest = () => {
const onReject = async() => {
try {
await managerApi.rejectDoctorRegReq(token, doctorDetail)
await managerApi.rejectDoctorRegReq(token, {
doctorId : doctorDetail.doctorId,
})
.then((res : any) => {
if(res.statusText === 'OK') {
Alert.onSuccess('회원 등록이 취소되었습니다.', fetchData);
...
...
@@ -112,13 +123,13 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
const onValidate = async () => {
try {
await managerApi.validateDoctorLicense(token, {
doctorLicense : doctorDetail.info.d
octorLicense,
validateD
octorLicense,
}).then(res => {
if(res.statusText === 'OK') {
setValidate(res.data.result ? 'Y' : 'N');
}
}).catch(err => {
Alert.onError(err.response.data, () => {
Alert.onError(err.response.data
.error
, () => {
setModalUp(false);
setValidate('W');
});
...
...
@@ -131,6 +142,12 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
}
};
useEffect(() => {
setValidate('W');
setValidateDoctorLicense('');
}, [modalUp]);
useEffect(() => {
fetchData();
}, []);
...
...
@@ -148,6 +165,9 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
validate = {validate}
onValidate = {onValidate}
validateDoctorLicense = {validateDoctorLicense}
onSetValidateDoctorLicense = {onSetValidateDoctorLicense}
onAcceptRequest = {onAcceptRequest}
onRejectRequest = {onRejectRequest}
/>
...
...
web/src/views/main/manager/ManagerMenuPresenter.tsx
View file @
4358d99
...
...
@@ -16,6 +16,9 @@ interface ManagerMenuProps {
validate : string;
onValidate : () => void;
validateDoctorLicense : string;
onSetValidateDoctorLicense : React.ChangeEventHandler<HTMLInputElement>;
onAcceptRequest : () => void;
onRejectRequest : () => void;
...
...
@@ -50,6 +53,8 @@ const ManagerMenuPresenter = (props : ManagerMenuProps) => {
<styled.ModalInfo>
<styled.DoctorLicenseViewInput
placeholder = '의사 면허 번호'
value = {props.validateDoctorLicense}
onChange = {props.onSetValidateDoctorLicense}
/>
<styled.ValidateButton
onClick = {props.onValidate}
...
...
Please
register
or
login
to post a comment