Skip to content

Commit bfb3776

Browse files
authored
Merge pull request #288 from manNomi/feat/univ-page
fix : category 버그 및 비로그인 입장 버그 수정
2 parents 58a5b24 + e61e0b5 commit bfb3776

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

src/api/boards/clients/useGetPostList.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AxiosResponse } from "axios";
22

3-
import { axiosInstance } from "@/utils/axiosInstance";
3+
import { publicAxiosInstance } from "@/utils/axiosInstance";
44

55
import { QueryKeys } from "./QueryKeys";
66

@@ -14,15 +14,15 @@ interface UseGetPostListProps {
1414
}
1515

1616
const getPostList = (boardCode: string, category: string | null = null): Promise<AxiosResponse<ListPost[]>> =>
17-
axiosInstance.get(`/boards/${boardCode}`, {
17+
publicAxiosInstance.get(`/boards/${boardCode}`, {
1818
params: {
1919
category,
2020
},
2121
});
2222

2323
const useGetPostList = ({ boardCode, category = null }: UseGetPostListProps) => {
2424
return useQuery({
25-
queryKey: [QueryKeys.postList],
25+
queryKey: [QueryKeys.postList, boardCode, category],
2626
queryFn: () => getPostList(boardCode, category),
2727
// staleTime을 무한으로 설정하여 불필요한 자동 refetch를 방지합니다.
2828
staleTime: Infinity,

src/app/community/[boardCode]/CommunityPageContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const CommunityPageContent = ({ boardCode }: CommunityPageContentProps) => {
2121
const router = useRouter();
2222
const [category, setCategory] = useState<string | null>("전체");
2323

24-
const { data: posts = [] } = useGetPostList({ boardCode });
24+
const { data: posts = [] } = useGetPostList({ boardCode, category });
2525

2626
const handleBoardChange = (newBoard: string) => {
2727
router.push(`/community/${newBoard}`);

src/app/my/_ui/MyProfileContent/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,17 @@ const MyProfileContent = () => {
7575
<div className="w-full cursor-pointer rounded-lg bg-secondary-500 py-2 text-center font-medium text-white">
7676
<Link href={"/my/modify"}>프로필 변경</Link>
7777
</div>
78-
<Link className="w-full" href={"/my/apply-mentor"}>
78+
{/* <Link className="w-full" href={"/my/apply-mentor"}>
7979
<button className="w-full rounded-lg bg-secondary-800 py-2 font-medium text-white">멘토 회원 전환</button>
80-
</Link>
80+
</Link> */}
81+
<button
82+
onClick={() => {
83+
toast.info("조금만 기다려주세요. [업데이트 중]");
84+
}}
85+
className="w-full rounded-lg bg-secondary-800 py-2 font-medium text-white"
86+
>
87+
멘토 회원 전환
88+
</button>
8189
</div>
8290
)}
8391
</div>

src/app/my/apply-mentor/_components/UniversityScreen/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ const UniversityScreen = ({ onNext }: UniversityScreenProps) => {
191191
주세요.
192192
</li>
193193
<li>실명을 제외한 개인정보는 모두 가려주세요.</li>
194+
<li>업로드 가능한 파일 유형은 [png, jpg, pdf] 입니다.</li>
194195
</ul>
195196
</div>
196197
</div>

src/app/my/apply-mentor/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { useRouter } from "next/navigation";
34
import { useState } from "react";
45
import { FormProvider, useForm } from "react-hook-form";
56

@@ -17,6 +18,7 @@ import { toast } from "@/lib/zustand/useToastStore";
1718
import { zodResolver } from "@hookform/resolvers/zod";
1819

1920
const ApplyMentorPage = () => {
21+
const router = useRouter();
2022
const [step, setStep] = useState<number>(1);
2123

2224
const methods = useForm<MentorApplicationFormData>({
@@ -34,7 +36,12 @@ const ApplyMentorPage = () => {
3436
const { mutate: postMentorApplication } = usePostMentorApplication();
3537

3638
const goNextStep = () => setStep((prev) => prev + 1);
37-
const goPrevStep = () => setStep((prev) => Math.max(1, prev - 1));
39+
const goPrevStep = () => {
40+
if (step === 1) {
41+
router.back();
42+
}
43+
setStep((prev) => Math.max(1, prev - 1));
44+
};
3845

3946
const progress = ((step - 1) / 3) * 100;
4047

0 commit comments

Comments
 (0)