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-08-21 22:15:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f4c0e0f54092d179be41cabdb34e2dbc15868d73
f4c0e0f5
1 parent
5783b300
feat. complete web
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
3 deletions
server/src/api/auth/auth.ctrl.js
web/src/api/api-manager.ts
web/src/views/main/manager/ManagerMenuContainer.tsx
web/src/views/main/manager/ManagerMenuPresenter.tsx
web/src/views/main/manager/ManagerMenuStyled.tsx
server/src/api/auth/auth.ctrl.js
View file @
f4c0e0f
...
...
@@ -100,13 +100,13 @@ exports.doctorRegister = async ctx => {
}
const
existDoctorInfo
=
await
DoctorInfo
.
findByDoctorId
(
userId
);
if
(
existDoctorInfo
.
useYn
===
'W'
)
{
if
(
existDoctorInfo
&&
existDoctorInfo
.
useYn
===
'W'
)
{
ctx
.
status
=
401
;
ctx
.
body
=
{
error
:
'가입 승인 대기중인 회원입니다.'
,
};
return
;
}
else
if
(
existDoctorInfo
.
useYn
===
'N'
)
{
}
else
if
(
existDoctorInfo
&&
existDoctorInfo
.
useYn
===
'N'
)
{
ctx
.
status
=
401
;
ctx
.
body
=
{
error
:
'가입이 거절된 회원입니다.'
,
...
...
web/src/api/api-manager.ts
View file @
f4c0e0f
...
...
@@ -30,4 +30,11 @@ export default {
},
});
},
validateDoctorLicense
:
(
token
:
RecoilState
<
any
>
,
Data
:
any
)
=>
{
return
client
.
post
(
'/manage/doctor/validate'
,
Data
,
{
headers
:
{
Authorization
:
token
,
},
});
},
};
\ No newline at end of file
...
...
web/src/views/main/manager/ManagerMenuContainer.tsx
View file @
f4c0e0f
...
...
@@ -21,11 +21,13 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
const [doctorDetail, setDoctorDetail] = useState<any>({});
const [modalUp, setModalUp] = useState<boolean>(false);
const [validate, setValidate] = useState<string>('W');
const fetchData = async() => {
setModalUp(false);
setValidate('W');
try {
await managerApi.getDoctorRegReqList(token)
...
...
@@ -43,6 +45,8 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
const onViewDetailReq = async (doctorId : string) => {
setValidate('W');
try {
await managerApi.getDoctorRegReqDetail(token, doctorId)
.then((res : any) => {
...
...
@@ -58,6 +62,14 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
//회원 가입 수락
const onAcceptRequest = () => {
if(validate === 'W') {
Alert.onError('먼저 의사의 자격번호가 유효한지 검증해주세요.', () => null);
return;
} else if(validate === 'N') {
Alert.onError('유효한 자격 번호가 아닙니다.', () => null);
return;
}
const onAccept = async() => {
try {
await managerApi.acceptDoctorRegReq(token, doctorDetail)
...
...
@@ -92,6 +104,28 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
Alert.onCheck('회원 가입 요청을 취소하시겠습니까?', onReject, () => null);
};
const onValidate = async () => {
try {
await managerApi.validateDoctorLicense(token, {
doctorLicense : doctorDetail.info.doctorLicense,
}).then(res => {
if(res.statusText === 'OK') {
setValidate(res.data.result ? 'Y' : 'N');
}
}).catch(err => {
Alert.onError(err.response.data, () => {
setModalUp(false);
setValidate('W');
});
})
} catch(e) {
Alert.onError(e.response.data, () => {
setModalUp(false);
setValidate('W');
});
}
};
useEffect(() => {
fetchData();
}, []);
...
...
@@ -104,6 +138,8 @@ const ManagerMenuContainer = (props : ManagerMenuProps) => {
modalUp = {modalUp}
setModalUp = {setModalUp}
onViewDetailReq = {onViewDetailReq}
validate = {validate}
onValidate = {onValidate}
onAcceptRequest = {onAcceptRequest}
onRejectRequest = {onRejectRequest}
...
...
web/src/views/main/manager/ManagerMenuPresenter.tsx
View file @
f4c0e0f
...
...
@@ -13,6 +13,8 @@ interface ManagerMenuProps {
modalUp : boolean;
setModalUp : any;
onViewDetailReq : (arg0 : string) => void;
validate : string;
onValidate : () => void;
onAcceptRequest : () => void;
onRejectRequest : () => void;
...
...
@@ -42,7 +44,23 @@ const ManagerMenuPresenter = (props : ManagerMenuProps) => {
<styled.ModalBodyLeftAndRight>
<styled.ModalInfoWrapper>
<styled.ModalInfoExplain>의사 자격 번호</styled.ModalInfoExplain>
<styled.ModalInfo>{props.doctorDetail.info.doctorLicense}</styled.ModalInfo>
<styled.ModalInfo>
{props.doctorDetail.info.doctorLicense}
<styled.ValidateButton
onClick = {props.onValidate}
disabled = {props.validate !== 'W'}
validate = {props.validate}
>
{
props.validate === 'Y' ?
'검증 완료' :
props.validate === 'W' ?
'검증' :
props.validate === 'N' ?
'검증 실패' : null
}
</styled.ValidateButton>
</styled.ModalInfo>
</styled.ModalInfoWrapper>
<styled.ModalInfoWrapper>
<styled.ModalInfoExplain>이름</styled.ModalInfoExplain>
...
...
web/src/views/main/manager/ManagerMenuStyled.tsx
View file @
f4c0e0f
...
...
@@ -194,6 +194,43 @@ export const ModalInfo = styled.div `
margin : 5px 0 20px 0;
font-size : 20px;
font-weight : 700;
display : flex;
flex-direction : row;
align-items : center;
`;
export const ValidateButton = styled.button<{validate : string}> `
margin : 0 0 0 15px;
padding : 2px 5px;
border-radius : 3px;
border : ${props => props.validate === 'W' ? '1px solid #343434'
: props.validate === 'Y' ? '1px solid #337DFF'
: props.validate === 'N' ? '1px solid #dedede' : 'transparent'
};
background-color : ${props => props.validate === 'W' ? 'transparent'
: props.validate === 'Y' ? '#377DFF'
: props.validate === 'N' ? '#f2f2f2' : 'transparent'
};
color : ${props => props.validate === 'W' ? '#343434'
: props.validate === 'Y' ? '#fff'
: props.validate === 'N' ? '#a0a0a0' : 'transparent'
};
transition : .25s all;
:not(:disabled) {
cursor : pointer;
&:hover {
background-color : #343434;
color : #fff;
border : 1px solid #343434;
}
}
`;
export const ModalButtonWrapper = styled.div `
...
...
Please
register
or
login
to post a comment