// CertificationNumScreen.tsx
const handleGetVerificationCode = async () => {
Alert.alert("인증번호 발송 완료! 이메일을 확인해주세요.");
const requestBody = {
email: email,
employeeId: employeeId,
};
console.log("Email:", email);
console.log("Employee ID:", employeeId);
// try {
// const response = await fetch(`${URL}/api/v1/sign`, {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// },
// body: JSON.stringify(requestBody),
// });
// const data = await response.json();
// console.log('Success:', data);
// } catch (error) {
// console.error('Error:', error);
// }
};
위 코드는 API 호출 코드임.
API 호출 == 백엔드와의 통신
형태는 동일하게 사용하되 requesBody 안의 내용을 swagger를 참고하여 작성하면 됨.
이 함수는 버튼 클릭 시 onPress 에 넣어 사용하면 됨.
<Button buttonText="인증번호 받기" style={styles.button} onPress={handleGetVerificationCode}></Button>
이런 식.
MainScreen에서 이메일과 사번 인증 완료
이메일과 사번을 CertificationNumScreen으로 보내줄 거임 (내가)
http://52.79.91.125:8080/swagger-ui/index.html#/employee-controller/test
그걸 그대로 ${URL}/api/v1/finish-sign 으로 위의 API의 requestBody를 수정하여 보내면 됨
인증코드가 확인되면 (서버에서 200 응답이 돌아오면)
이 이메일과 사번으로 web3 계정 생성 후 PrivateKeyScreen으로 넘어가 PrivateKey 복사를 하게 만들 것