Skip to content

Commit

Permalink
hotfix :: 지원 가능 상태일 때만 지원하기 버튼 UI 보이게
Browse files Browse the repository at this point in the history
  • Loading branch information
KANGYONGSU23 committed Apr 10, 2024
1 parent 2103d83 commit 54445c1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 26 deletions.
17 changes: 1 addition & 16 deletions src/apis/applications/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,10 @@ export function useReapply(applicationId: string | null) {
type: "RED",
});
break;
case 401:
append({
title: "",
message: "3학년이 아닌 학생은 지원할 수 없습니다.",
type: "RED",
});
break;
case 404:
append({
title: "",
message: "모집 기간이 아니거나 모집의뢰서가 존재하지 않습니다.",
type: "RED",
});
break;
case 409:
append({
title: "",
message:
"이미 해당 모집의뢰에 지원했거나 승인된 지원요청이 존재합니다.",
message: "지원서가 존재하지 않습니다.",
type: "RED",
});
break;
Expand Down
1 change: 1 addition & 0 deletions src/apis/recruitments/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface RecruitmentsDetailType extends RecruitmentsDetailTable {
company_name: string;
bookmarked: boolean;
recruitment_id: number;
is_applicable: boolean;
}

export interface RecruitmentsDetailTable {
Expand Down
31 changes: 21 additions & 10 deletions src/app/recruitments/detail/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ import { useRouter, useSearchParams } from "next/navigation";
export default function RecruitmentsDetailPage() {
const param = useSearchParams();
const navigator = useRouter();
const { data: RecruitmentsDetial } = useGetRecruitmentsDetail(param.get("id")!);
const { data: RecruitmentsDetial } = useGetRecruitmentsDetail(
param.get("id")!
);
if (RecruitmentsDetial) {
const { company_id, company_name, company_profile_url, bookmarked, recruitment_id, ...rest } =
RecruitmentsDetial;
const {
company_id,
company_name,
company_profile_url,
bookmarked,
recruitment_id,
is_applicable,
...rest
} = RecruitmentsDetial;

return (
<div className="w-full my-[56px]">
Expand All @@ -23,13 +32,15 @@ export default function RecruitmentsDetailPage() {
bookmarked={bookmarked}
recruitmentId={recruitment_id}
>
<GhostBtn
onClick={() => {
navigator.push(`/recruitments/apply/?id=${param.get("id")}`);
}}
>
지원하기
</GhostBtn>
{is_applicable && (
<GhostBtn
onClick={() => {
navigator.push(`/recruitments/apply/?id=${param.get("id")}`);
}}
>
지원하기
</GhostBtn>
)}
</CompanyTitle>
<RecruitmentsTable {...rest} />
</div>
Expand Down

0 comments on commit 54445c1

Please sign in to comment.