Skip to content

Commit

Permalink
Merge pull request #189 from KW-MUJI/develop
Browse files Browse the repository at this point in the history
refector: 콘솔 내용 삭제
  • Loading branch information
goodsmell authored Dec 6, 2024
2 parents b5869cf + 9d050b3 commit fd1ab0d
Show file tree
Hide file tree
Showing 25 changed files with 111 additions and 110 deletions.
4 changes: 2 additions & 2 deletions src/api/authApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const resetPw = async (email, pass, passcon) => {
},
body: JSON.stringify(requestBody),
});
console.log(response);
// console.log(response);
if (!response.ok) {
throw new Error("Network response was not ok");
}
Expand All @@ -115,7 +115,7 @@ export const refreshAccessToken = async (refreshToken) => {
// 새 Access Token을 localStorage에 저장
localStorage.setItem("accessToken", accessToken);

console.log("Access Token 갱신 성공:", accessToken);
// console.log("Access Token 갱신 성공:", accessToken);

return accessToken;
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions src/api/calendarApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const fetchCalendar = async (yearMonth) => {
},
}
);
console.log(response);
// console.log(response);
return response.data;
} catch (error) {
console.error(error);
Expand All @@ -29,7 +29,7 @@ export const addCalendarEvent = async (accessToken, eventData) => {
eventDate: eventData.eventDate,
};

console.log("일정 추가 함수 호출됨");
// console.log("일정 추가 함수 호출됨");
const response = await apiClient.post(
`${CALENDAR_URL.endpointUrl}/add`,
requestBody,
Expand Down
6 changes: 3 additions & 3 deletions src/api/mypageApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const CheckPassword = async (pass, accessToken) => {
try {
const formData = new FormData();
formData.append("password", pass);
console.log(pass.password);
// console.log(pass.password);

const response = await fetch(`${API_BASE_URL}/mypage/checkPw`, {
method: "POST",
Expand All @@ -18,7 +18,7 @@ export const CheckPassword = async (pass, accessToken) => {
},
body: JSON.stringify(pass.password),
});
console.log(response);
// console.log(response);
return response.status;
} catch (error) {
console.error("[ERROR] Update Project:", error.response || error.message);
Expand Down Expand Up @@ -70,7 +70,7 @@ export const updateUserInfo = async (accessToken, formData) => {
},
}
);
console.log(response);
// console.log(response);
return response;
};

Expand Down
2 changes: 1 addition & 1 deletion src/api/noticeApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getNotices = async (page, searchVal, srCategoryId) => {
params, // 쿼리 파라미ㄴ터 전달
});
if (response.data.code === 200) {
console.log("공지사항 요청 성공:", response.data);
// console.log("공지사항 요청 성공:", response.data);
return response.data.data; // notices와 maxPage 반환
} else {
console.error("공지사항 요청 실패 코드:", response.data.code);
Expand Down
30 changes: 15 additions & 15 deletions src/api/teamApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ export const registerTeam = async (teamData, accessToken) => {
formData.append("deadlineAt", teamData.deadlineAt);
formData.append("image", teamData.image); // 이미지 파일 추가

console.log("이미지 내용:", teamData.image);
// console.log("이미지 내용:", teamData.image);

console.log("FormData 내용:", Array.from(formData.entries()));
// console.log("FormData 내용:", Array.from(formData.entries()));

const response = await apiClient.post("/team/register", formData, {
headers: {
"Content-Type": "multipart/form-data",
Authorization: `Bearer ${accessToken}`, // 토큰 추가
},
});
console.log("토큰:", accessToken);
console.log("Authorization 헤더:", `Bearer ${accessToken}`);
console.log("데이터 내용:", response.data);
// console.log("토큰:", accessToken);
// console.log("Authorization 헤더:", `Bearer ${accessToken}`);
// console.log("데이터 내용:", response.data);

return response.data;
} catch (error) {
console.error("[ERROR] Team Register:", error.response || error.message);
console.log("토큰:", accessToken);
console.log("Authorization 헤더:", `Bearer ${accessToken}`);
console.log("Base URL:", apiClient.defaults.baseURL);
// console.log("토큰:", accessToken);
// console.log("Authorization 헤더:", `Bearer ${accessToken}`);
// console.log("Base URL:", apiClient.defaults.baseURL);

throw error;
}
Expand All @@ -41,7 +41,7 @@ export const getTeampleDetail = async (projectId, accessToken) => {
Authorization: `Bearer ${accessToken}`,
},
});
console.log("getTeampleDetail데이터:", response.data);
// console.log("getTeampleDetail데이터:", response.data);
return response.data;
} catch (error) {
console.error(
Expand Down Expand Up @@ -79,14 +79,14 @@ export const postPortfolio = async (accessToken, resumeId, projectId) => {
try {
const response = await apiClient.post(url, body, { headers });
if (response.data.code === 200) {
console.log("포트폴리오 선택 성공 :", response.data.data);
// console.log("포트폴리오 선택 성공 :", response.data.data);
return response.data.data;
} else {
console.error("포트폴리오 선택 실패 오류 코드 :", response.data.code);
}

console.log("Resume ID:", resumeId);
console.log("Project ID:", projectId);
// console.log("Resume ID:", resumeId);
// console.log("Project ID:", projectId);
} catch (error) {
console.error("postProtfolio API 에러:", error.response || error.message);
throw error;
Expand All @@ -95,15 +95,15 @@ export const postPortfolio = async (accessToken, resumeId, projectId) => {

export const getTeampleList = async (page = 0, search = "") => {
try {
console.log("API 호출: /team/", page, search); // 요청 URL 확인
console.log("요청 파라미터:", { page });
// console.log("API 호출: /team/", page, search); // 요청 URL 확인
// console.log("요청 파라미터:", { page });
const response = await apiClient.get("/team", {
params: {
page,
search,
},
});
console.log("API 응답 데이터:", response.data); // 응답 데이터 확인
// console.log("API 응답 데이터:", response.data); // 응답 데이터 확인
return response.data;
} catch (error) {
console.error("[ERROR] teamApi/getTeampleList 오류");
Expand Down
4 changes: 2 additions & 2 deletions src/components/CheckPw.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const CheckPw = () => {
const requestAuth = async (e) => {
e.preventDefault();
const result = await CheckPassword(formData, accessToken);
console.log(formData);
console.log(result);
// console.log(formData);
// console.log(result);

if(result != 200){
alert("비밀번호가 일치하지 않습니다.");
Expand Down
16 changes: 8 additions & 8 deletions src/components/MyTeam/My_recruit_team.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const MyRecruitTeam = () => {
try {
const response = await getMyProjectApplicant(accessToken);
setProjectList(response.data);
console.log("프로젝트세부내용 확인 : ", response.data);
// console.log("프로젝트세부내용 확인 : ", response.data);
} catch (error) {
console.error("fetchApplicantLists 에러", error);
}
Expand All @@ -193,13 +193,13 @@ const MyRecruitTeam = () => {
const deleteTeam = async (teamID) => {
try {
const response = await deleteProject(accessToken, teamID);
console.log("지울 팀", teamID);
// console.log("지울 팀", teamID);
if (response) {
// 상태 업데이트
setProjectList((prevList) =>
prevList.filter((project) => project.id !== teamID)
);
console.log("팀플 삭제 완료");
// console.log("팀플 삭제 완료");
}
} catch (error) {
console.error("팀플 삭제 중 에러 발생:", error.message);
Expand All @@ -210,15 +210,15 @@ const MyRecruitTeam = () => {
const handleStart = async (teamID) => {
try {
setStartProject((prev) => [...prev, teamID]);
console.log("selectParticipant[teamID]", selectParticipant[teamID]);
console.log("teamID", teamID);
// console.log("selectParticipant[teamID]", selectParticipant[teamID]);
// console.log("teamID", teamID);
const response = await startTeamProject(
accessToken,
selectParticipant[teamID], // 해당 팀의 선택된 지원자 전달
teamID
);
if (response) {
console.log(`${teamID} 팀플 시작됨`);
// console.log(`${teamID} 팀플 시작됨`);
// 백엔드에서 최신 데이터를 다시 가져오기
const updatedResponse = await getMyProjectApplicant(accessToken);
setProjectList(updatedResponse.data); // 최신 데이터로 상태 업데이트
Expand Down Expand Up @@ -246,15 +246,15 @@ const MyRecruitTeam = () => {
...prev,
[teamID]: [...(prev[teamID] || []), participantId], // 해당 팀 배열에 추가
}));
console.log(`Team ${teamID} selected:`, participantId);
// console.log(`Team ${teamID} selected:`, participantId);
};

const handlesUnSelectApplicant = (teamID, participantId) => {
setSelectParticipant((prev) => ({
...prev,
[teamID]: prev[teamID]?.filter((id) => id !== participantId) || [], // 해당 팀 배열에서 제거
}));
console.log(`Team ${teamID} unselected:`, participantId);
// console.log(`Team ${teamID} unselected:`, participantId);
};

return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/MyTeam/My_team_applicant.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const MyTeamApplicant = () => {

if (foundApplicant) {
setApplicant(foundApplicant); // 지원자 데이터 설정
console.log(foundApplicant);
// console.log(foundApplicant);
} else {
alert("해당 지원자를 찾을 수 없습니다.");
navigate(-1); // 이전 페이지로 이동
Expand All @@ -51,7 +51,7 @@ const MyTeamApplicant = () => {
return <div>지원자를 찾고 있습니다...</div>;
}
const normalizedPath = applicant.resume.replace(/\\/g, "/");
console.log("Normalized Path:", normalizedPath);
// console.log("Normalized Path:", normalizedPath);
return (
<div className={styles.MyTeamApplicant_container}>
<div className={styles.container_head}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/My_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const MyPage = () => {
try {
const data = await getInfo(accessToken);

console.log(data);
// console.log(data);
setProfile(data.profile);
setImgSrc(data.profile.userImage);
setMyTeams(data.projects || []);
Expand Down
7 changes: 4 additions & 3 deletions src/components/Notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ const Notice = () => {
const [searchVal, setSearchVal] = useState(""); // 검색어 상태
const [searchQuery, setSearchQuery] = useState(""); // 실제 검색에 사용될 값


const fetchData = async () => {
try {
const data = await getNotices(page, searchQuery, srCategoryId);
setNotices(data.notices);
setTotalPages(data.maxPage); //API에서 전체 페이지 수 받아오기
console.log("Notice:", notice);
console.log("totalPages:", totalPages);
console.log("page:", page);
// console.log("Notice:", notice);
// console.log("totalPages:", totalPages);
// console.log("page:", page);
} catch (error) {
console.error("Error fetching notices:", error);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/PwFind.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const PwFind = () => {

try {
const data = await sendAuthRequest(email, false);
console.log(data);
// console.log(data);
setIsPinVerified(false);
setIsTimerActive(true);
setTimer(300);
Expand All @@ -86,7 +86,7 @@ const PwFind = () => {
const email = id + fixedDomain; // 이메일 형식으로 변환
try {
const data = await verifyPinRequest(email, pin);
console.log(data);
// console.log(data);

const textElement = document.getElementById(styles.text);
if (data.code === 200 && data.data) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/PwResrt.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const PwReset = () => {
const pw_confirm = async (e) => {
e.preventDefault();
const { password, password_confirm } = formData;
console.log(password);
console.log(password_confirm);
// console.log(password);
// console.log(password_confirm);
let regPass = /^(?=.*[a-zA-Z])(?=.*[!@#$%^*+=-])(?=.*[0-9]).{5,11}$/;
if (!regPass.test(password)) {
alert("영문, 숫자, 특수기호 조합으로 5-11자리 이상 입력해주세요.");
Expand Down
24 changes: 12 additions & 12 deletions src/components/Schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ const Schedule = () => {
const yearMonth = `${currentDate.getFullYear()}-${String(
currentDate.getMonth() + 1
).padStart(2, "0")}`;
console.log(yearMonth);
// console.log(yearMonth);
const data = await fetchCalendar(yearMonth); // API를 통해 데이터 가져오기 calendar.response
if (data && data.data) {
setSchedules(data.data); // 가져온 데이터를 스케줄 상태로 설정
console.log("asd", data.data);
// console log("asd", data.data);
if (data.data.projects) setTeams(data.data.projects);
else setTeams([]);
} else {
Expand Down Expand Up @@ -121,7 +121,7 @@ const Schedule = () => {
}));
return responses;
} catch (error) {
console.log(error);
// console.log(error);
}
}

Expand All @@ -143,7 +143,7 @@ const Schedule = () => {
}));
return responses;
} catch (error) {
console.log(error);
// console.log(error);
}
}
};
Expand All @@ -157,9 +157,9 @@ const Schedule = () => {

//해당 달 일정
const mySchedule = () => {
console.log("userEvents:", userEvents);
console.log("univEvents:", univEvents);
console.log("projectEvents:", projectEvents);
// console.log("userEvents:", userEvents);
// console.log("univEvents:", univEvents);
// console.log("projectEvents:", projectEvents);

//시간순
allSchedules.sort((a, b) => {
Expand Down Expand Up @@ -258,11 +258,11 @@ const Schedule = () => {
eventDate: `${date} ${time}:00`,
};

console.log("추가할 이벤트:", newEvent); // 콘솔로 새로운 일정 출력
// console.log("추가할 이벤트:", newEvent); // 콘솔로 새로운 일정 출력

try {
const response = await addCalendarEvent(accessToken, newEvent); //API요청
console.log(response);
// console.log(response);
if (response.status === 200) {
if (isSelected === "개인일정") {
setSchedules({
Expand All @@ -272,7 +272,7 @@ const Schedule = () => {
userEvents: [...schedules.events.userEvents, newEvent], // 새로운 일정 추가
},
});
console.log("개인일정 추가 성공:", response);
// console.log("개인일정 추가 성공:", response);
} else {
//팀플 일정 추가(선택한 팀 ID 포함)
if (selectedTeam) {
Expand All @@ -283,7 +283,7 @@ const Schedule = () => {
projectEvents: [...schedules.events.projectEvents, newEvent],
},
});
console.log("팀플일정 추가 성공");
// console.log("팀플일정 추가 성공");
}
}

Expand Down Expand Up @@ -426,7 +426,7 @@ const Schedule = () => {
const handleTeamChange = (e) => {
const selected = teams.find((team) => team.name === e.target.value);
setSelectedTeam(selected);
console.log("선택된 팀:", selected); // 팀이 제대로 선택되는지 확인
// console.log("선택된 팀:", selected); // 팀이 제대로 선택되는지 확인
};

const handleClick = (e) => {
Expand Down
Loading

0 comments on commit fd1ab0d

Please sign in to comment.