Skip to content

Commit

Permalink
Merge branch 'main' into feature/52-BannerApi
Browse files Browse the repository at this point in the history
  • Loading branch information
dnjsdmswl authored Apr 23, 2024
2 parents da5a8f6 + b171b2e commit 158fe50
Show file tree
Hide file tree
Showing 50 changed files with 1,081 additions and 241 deletions.
169 changes: 126 additions & 43 deletions .pnp.cjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"@yarnpkg/sdks": "^3.0.0-rc.49",
"autoprefixer": "^10.4.15",
"autoprefixer": "^10.4.17",
"eslint": "^8.50.0",
"eslint-config-next": "^13.5.3",
"postcss": "^8.4.29",
"tailwindcss": "^3.3.3",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"typescript": "4.7.2"
}
}
Binary file removed public/WinterIntrenBanner.webp
Binary file not shown.
18 changes: 2 additions & 16 deletions src/apis/applications/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function useApplyToCompany(recruitmentId: string) {
case 404:
append({
title: "",
message: "모집의뢰서가 존재하지 않습니다.",
message: "모집 기간이 아니거나 모집의뢰서가 존재하지 않습니다.",
type: "RED",
});
break;
Expand Down Expand Up @@ -85,28 +85,14 @@ export function useReapply(applicationId: string | null) {
message: "승인요청 또는 반려상태가 아닙니다.",
type: "RED",
});
case 401:
append({
title: "",
message: "3학년이 아닌 학생은 지원할 수 없습니다.",
type: "RED",
});
break;
case 404:
append({
title: "",
message: "모집의뢰서가 존재하지 않습니다.",
message: "지원서가 존재하지 않습니다.",
type: "RED",
});
break;
case 409:
append({
title: "",
message:
"이미 해당 모집의뢰에 지원했거나 승인된 지원요청이 존재합니다.",
type: "RED",
});

default:
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/apis/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { AuthCode, IAuthorizationResponse, SendAuthCodeType } from "./type";
const router = "/auth";

export const useReissueToken = async (refresh_token: string) => {
const response = await axios.put<IAuthorizationResponse>(
`${process.env.NEXT_PUBLIC_BASE_URL}${router}/reissue?platform_type=WEB`,
const response = await axios.put<IAuthorizationResponse>(
`${process.env.NEXT_PUBLIC_BASE_URL}${router}/reissue?platform-type=WEB`,
null,
{
headers: {
Expand Down
2 changes: 2 additions & 0 deletions src/apis/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ instance.interceptors.response.use(
const accessExpired = new Date(res.access_expires_at);
const refreshExpired = new Date(res.refresh_expires_at);
cookies.set("access_token", res.access_token, {
path: '/',
expires: accessExpired,
});
cookies.set("refresh_token", res.refresh_token, {
path: '/',
expires: refreshExpired,
});
if (config!.headers) {
Expand Down
9 changes: 5 additions & 4 deletions src/apis/bookmarks/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export interface BookmarkResponseType {
}

export interface BookmarkItemsType {
company_name: string;
recruitment_id: number;
created_at: string;
}
"company_logo_url": string;
"company_name": string;
"recruitment_id": number;
"created_at": string;
}
12 changes: 11 additions & 1 deletion src/apis/companies/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useQuery } from "@tanstack/react-query";
import { useToastStore } from "@team-return/design-system";
import { instance } from "../axios";
import { GetNumberOfPagesType } from "../recruitments/type";
import { CompaniesDetailsType, CompaniesListResponseType } from "./type";
import { CompaniesDetailsType, CompaniesListResponseType, GetCompaniesForReviewingResponse } from "./type";

const router = "/companies";

Expand Down Expand Up @@ -56,3 +56,13 @@ export const useGetNumberOfCompaniesListPages = (queryString: string) => {
);
return data;
};

export const useGetCompaniesForReviewing = () => {
return useQuery(
["getCompaniesForReviewing"],
async () => {
const {data} = await instance.get<GetCompaniesForReviewingResponse>(`${router}/review`);
return data;
}
)
}
12 changes: 11 additions & 1 deletion src/apis/companies/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,20 @@ export interface CompaniesDetailsTable {
fax: string | null;
email: string;
representative_name: string;
representative_phone_no: string;
founded_at: string;
worker_number: number;
take: number;
attachments: any[];
service_name: string;
business_area: string;
}
}

export interface CompaniesForReviewType {
id: number,
name: string,
}

export interface GetCompaniesForReviewingResponse {
companies : CompaniesForReviewType[]
}
23 changes: 17 additions & 6 deletions src/apis/file/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,23 @@ export const useCreatePresignedURL = () => {
});
},
onError: (error: AxiosError) => {
if (error.response)
append({
title: "",
message: "파일 업로드에 실패했습니다.",
type: "RED",
});
switch (error.response?.status) {
case 400 : {
append({
title: '',
message: '잘못된 파일 확장자입니다.',
type: 'RED',
})
}
break;
default : {
append({
title: "",
message: "파일 업로드에 실패했습니다.",
type: "RED",
});
}
}
},
}
);
Expand Down
10 changes: 10 additions & 0 deletions src/apis/notice/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NoticeListResponse } from "./type";
import { NoticeDetailResponse } from "./type";

export const useGetNoticeList = () => {

};

export const useGetNoticeDetail = () => {

};
14 changes: 14 additions & 0 deletions src/apis/notice/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface NoticeListResponse {
notices: {
notice_id: number;
title: string;
createAt: string;
}[];
};

export interface NoticeDetailResponse {
title: string;
content: string;
createAt: string;
attachments: string[];
}
16 changes: 12 additions & 4 deletions src/apis/recruitments/type.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { instance } from "../axios";
export interface RecruitmentsListResponseType {
recruitments: RecruitmentsListType[];
}
Expand All @@ -17,13 +18,15 @@ export interface RecruitmentsDetailType extends RecruitmentsDetailTable {
company_id: number;
company_profile_url: string;
company_name: string;
bookmarked: boolean;
recruitment_id: number;
is_applicable: boolean;
}

export interface RecruitmentsDetailTable {
areas: AreasType[];
required_grade: number | null;
start_time: string;
end_time: string;
working_hours: string;
required_licenses: string[] | [];
hiring_progress: HiringProgressType[];
train_pay: number;
Expand All @@ -36,10 +39,15 @@ export interface RecruitmentsDetailTable {
etc: string | null;
}

interface CodeType {
id: number;
name: string;
}

export interface AreasType {
id: number;
job: string[];
tech: string[];
job: CodeType[];
tech: CodeType[];
hiring: number;
major_task: string;
preferential_treatment: string | null;
Expand Down
51 changes: 49 additions & 2 deletions src/apis/reviews/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { useQuery } from "@tanstack/react-query";
import { MutationOptions, useMutation, UseMutationOptions, useQuery } from "@tanstack/react-query";
import { useToastStore } from "@team-return/design-system";
import { AxiosError, AxiosResponse } from "axios";
import { instance } from "../axios";
import {
getReviewDetailResponseProps,
getReviewListResponseProps
getReviewListResponseProps,
createReviewRequestType,
} from "./type";

const router = "/reviews";
Expand All @@ -24,3 +27,47 @@ export const useGetReviewDetails = (reviewId: string) => {
return data;
});
};

export const useCreateReviews = (options: Omit<UseMutationOptions<AxiosResponse<any, any>, unknown, createReviewRequestType, unknown>, "mutationFn">) => {
const { append } = useToastStore();
return useMutation(
async (body: createReviewRequestType) =>
await instance.post(`${router}`, body),
{
...options,
onError: (err: AxiosError) => {
const { response } = err;
switch (response?.status) {
case 400: {
append({
title: "",
message: "입력값은 비어있으면 안됩니다.",
type: "RED",
});
break;
}
case 404: {
switch ((response as AxiosResponse<{ message: string }>).data.message) {
case "Code Not Found": {
append({
title: "",
message: "질문 분야가 누락되었습니다.",
type: "RED",
});
break;
}
case 'ApplicationEntity Not Found': {
append({
title: '',
message: '해당 기업에는 후기를 작성할 수 없습니다.',
type: 'RED',
})
}
}

}
}
},
}
);
};
11 changes: 11 additions & 0 deletions src/apis/reviews/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,14 @@ export interface getReviewDetailProps {
answer: string;
area: string;
}

export interface qnaElementsType {
question: string;
answer: string;
code_id: number;
}

export interface createReviewRequestType {
company_id: number;
qna_elements: qnaElementsType[]
}
Loading

0 comments on commit 158fe50

Please sign in to comment.