내부 api 삭제

This commit is contained in:
2025-11-24 22:50:28 +09:00
parent 74eee0a3c0
commit eaec13e386
14 changed files with 342 additions and 1863 deletions

View File

@@ -27,12 +27,36 @@ export default function FindIdPage() {
return Object.keys(next).length === 0;
}
function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
async function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault();
if (!validateAll()) return;
const mockUserId = `${name.trim()}@example.com`;
setFoundUserId(mockUserId);
setIsDoneOpen(true);
try {
const response = await fetch('https://hrdi.coconutmeet.net/auth/find-id', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: name,
phone: phone,
}),
});
if (!response.ok) {
const errorData = await response.json().catch(() => ({}));
console.error('아이디 찾기 실패:', errorData.error || response.statusText);
setIsFailedOpen(true);
return;
}
const data = await response.json();
setFoundUserId(data.email);
setIsDoneOpen(true);
} catch (error) {
console.error('아이디 찾기 오류:', error);
setIsFailedOpen(true);
}
}
return (