Skip to content

Commit

Permalink
Fix : 신청폼 파트 선택 이슈 해결 및 console.log 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
teagu123 committed Jul 2, 2024
1 parent 1fa248c commit a9c1668
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/api/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const requestIdtoken = async (
provider: string | undefined,
) => {
return await axiosInstance
.get(`/api/v1/auth/${provider}/idtoken?code=${authorizationCode}`)
.get(`/api/v1/auth/${provider}/idToken/local?code=${authorizationCode}`)
.then(response => {
localStorage.setItem('idtoken', response.data.data.idToken);
return response.data.data.idToken;
Expand Down
4 changes: 4 additions & 0 deletions src/components/application/ApplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ const ApplicationForm = () => {
if (hackathonResponse.data.length === 0) {
setIsSuccess(false);
} else {
setValue(
'hackathonParts',
hackathonResponse.data.data.hackathonParts,
);
setIsSuccess(true);
}
} catch (error) {
Expand Down
11 changes: 6 additions & 5 deletions src/components/application/ApplicationModify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ const ApplicationForm = () => {

const fetchData = async () => {
try {
const response = await request<null, null, null>({
const response = await request<null, any, null>({
uri: `/api/v1/hackathons/${hackathonId}`,
method: 'get',
});

setHackathonData(response.data);
} catch (error) {
console.error('Error fetching data:', error);
Expand Down Expand Up @@ -138,7 +139,6 @@ const ApplicationForm = () => {
};

const handleCancelOption = (option: string) => {
console.log(option);
const newValue = selectedParts.filter(selected => selected !== option);
setValue('hackathonParts', newValue.length > 0 ? newValue : []);
};
Expand Down Expand Up @@ -175,8 +175,10 @@ const ApplicationForm = () => {
}
if (hackathonData?.hackathonParts) {
let arr = [];

for (let i = 0; i < hackathonData.hackathonParts.length; i++) {
arr.push(hackathonData.hackathonParts[i]);

setValue('hackathonParts', arr);
}
}
Expand All @@ -203,17 +205,16 @@ const ApplicationForm = () => {
console.error('서버 요청 오류:', error);
}
};
console.log('수정');

const onSubmit = (data: ApplicationFormType) => {
console.log(data);
let datas = {
phone: data.phone,
hackathonParts: data.hackathonParts,
teamName: data.teamName,
offlineParticipation: data.offlineParticipation,
reasonForNotOffline: data.reasonForNotOffline,
};
console.log(data);

setHackathonData(datas);
setIsModalOpen(true);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/application/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Dropdown = ({
{trackOption.map(track => (
<Controller
key={track}
name="hackathonPart"
name="hackathonParts"
control={control}
render={({ field }) => {
const fieldValue = field.value as string[];
Expand Down Expand Up @@ -108,7 +108,7 @@ const Dropdown = ({
{trackOption.map(track => (
<Controller
key={track}
name="hackathonPart"
name="hackathonParts"
control={control}
render={({ field }) => {
const fieldValue = field.value as string[];
Expand Down
1 change: 0 additions & 1 deletion src/components/utils/ImageUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class ImageUpload {
static async enrollImagesToS3(file: File, presignedUrl: string) {
const response = await axios.put(presignedUrl, file);
if (response.status !== 200) {
console.log('S3 오류');
return;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/pages/admin/components/modal/hackathonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ interface HackathonModalProps {
}

function HackathonModal({ onCancel, reason }: HackathonModalProps) {
console.log(reason);
return (
<>
<BackgroundOverlay>
Expand Down
4 changes: 1 addition & 3 deletions src/pages/chat/components/ChatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const ChatList = () => {
}

// 비동기 처리
useEffect(() => {
console.log(activeUserName);
}, [activeUserName]);
useEffect(() => {}, [activeUserName]);

return (
<L.Container>
Expand Down
1 change: 0 additions & 1 deletion src/pages/chat/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const Input = () => {
const openImageModal = (e: React.MouseEvent<HTMLInputElement>) => {
e.preventDefault();
setIsImgClick(!isImgClick);
console.log('Send image?');
};

const onInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
Expand Down
1 change: 0 additions & 1 deletion src/pages/mypage/components/UserInfoModify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const UserInfoModify = () => {
let label: string;
if (field === 'part') {
label = findLabelByValue(selectedOption.value);
console.log(label);
}
setFormState(prev => ({
...prev,
Expand Down
1 change: 0 additions & 1 deletion src/pages/recruit/components/FooterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ const FooterModal = ({ isOpen, closeModal }: FooterModalProps) => {
{ email: email },
);

console.log(response.data);
setSuccess(response.data.isSuccess);
} catch (error) {
console.error('Error submitting form:', error);
Expand Down
1 change: 0 additions & 1 deletion src/pages/univRecruit/UnivModalMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const UnivModalMobile = ({ isOpen, closeModal }: FooterModalProps) => {
{ email: email },
);

console.log(response.data);
setSuccess(response.data.isSuccess);
} catch (error) {
console.error('Error submitting form:', error);
Expand Down
2 changes: 0 additions & 2 deletions src/query/get/useServerSidePagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ function useServerSidePagination<T>({
const [totalElements, setTotalElements] = useState<number>(0);

const [pageInfo, setPageInfo] = useSearchParams();
console.log(typeof pageInfo.get('page'));
// (if) 페이지 정보가 없을 때 pageInfo를 채워넣음
// (else if) page=1 이 아니면서 검색을 했을때 page=1, currentPage=1 로 변경
useEffect(() => {
Expand All @@ -79,7 +78,6 @@ function useServerSidePagination<T>({
setPageInfo(pageInfo);
setCurrentPage(1);
} else if (pageInfo.get('page') !== '1' && (search || univName)) {
console.log('안되나');
pageInfo.set('page', '1');
setPageInfo(pageInfo);
setCurrentPage(1);
Expand Down

0 comments on commit a9c1668

Please sign in to comment.