-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat/#86 메인페이지 필터 API 구현, Pagination 컴포넌트 추가 및 GoogleOAuth API 연동 작업
- Loading branch information
Showing
45 changed files
with
481 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { clientInstance } from '@apis/instance'; | ||
import { useMutation } from '@tanstack/react-query'; | ||
import { AxiosError } from 'axios'; | ||
import { OAuthRequest } from '../../types/request'; | ||
import { OAuthResponse } from '../../types/response'; | ||
import { APIPath } from '@/apis/apiPath'; | ||
|
||
const postOAuth = async ({ code }: OAuthRequest): Promise<OAuthResponse> => { | ||
const res = await clientInstance.post(APIPath.postOAuth, { code }); | ||
|
||
const authorizationHeader = res.headers['authorization']; | ||
const accessToken = authorizationHeader.replace('Bearer ', ''); | ||
|
||
if (!accessToken) { | ||
throw new Error('Authorization header is missing in the response'); | ||
} | ||
|
||
return { | ||
accessToken, | ||
type: res.data.type, | ||
profileImage: res.data.profileImage, | ||
name: res.data.name, | ||
}; | ||
}; | ||
|
||
export function useGoogleOAuthMutation() { | ||
return useMutation<OAuthResponse, AxiosError, OAuthRequest>({ | ||
mutationFn: postOAuth, | ||
}); | ||
} |
10 changes: 5 additions & 5 deletions
10
src/apis/auth/mutations/useRegister.tsx → ...h/hooks/mutations/useRegisterMutation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export interface OAuthRequest { | ||
token: string; | ||
code: string; | ||
} | ||
|
||
export interface RegisterRequest { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { AxiosError } from 'axios'; | ||
import { RecruitmentResponse } from '../../types/response'; | ||
import { useSuspenseQuery, UseSuspenseQueryResult } from '@tanstack/react-query'; | ||
import { clientInstance } from '@apis/instance'; | ||
import { QUERY_KEYS } from './queryKeys'; | ||
import { getDynamicAPIPath } from '@/apis/apiPath'; | ||
|
||
const getRecruitments = async (filter: string, page: number): Promise<RecruitmentResponse[]> => { | ||
const url = `${getDynamicAPIPath.getRecruitments(filter)}?page=${page}`; | ||
const res = await clientInstance.get<RecruitmentResponse[]>(url); | ||
return res.data; | ||
}; | ||
|
||
export const useFetchRecruitments = ( | ||
filter: string, | ||
page: number, | ||
): UseSuspenseQueryResult<RecruitmentResponse[], AxiosError> => { | ||
return useSuspenseQuery<RecruitmentResponse[], AxiosError>({ | ||
queryKey: [QUERY_KEYS.RECRUITMENTS, filter, page], | ||
queryFn: () => getRecruitments(filter, page), | ||
}); | ||
}; |
7 changes: 4 additions & 3 deletions
7
src/apis/home/queries/useFetchSlides.tsx → ...pis/home/hooks/queries/useFetchSlides.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Languages } from '../Languages'; | ||
|
||
export const signInData = { | ||
[Languages.KO]: { | ||
heading: '지금 바로 시작하세요. 🚀', | ||
description: '안정적이고 투명한 고용 관계의 시작, 지금 바로 경험해보세요!', | ||
}, | ||
[Languages.VE]: { | ||
heading: 'Bắt đầu ngay bây giờ. 🚀', | ||
description: 'Trải nghiệm sự khởi đầu của mối quan hệ lao động ổn định và minh bạch, ngay bây giờ!', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Languages } from '../Languages'; | ||
|
||
export const signUpData = { | ||
[Languages.KO]: { | ||
heading: '가입자 정보 선택', | ||
description: '대상에 해당하는 가입자 정보를 선택해주세요.', | ||
buttons: { | ||
employer: '사업주 가입', | ||
employee: '근로자 가입', | ||
}, | ||
}, | ||
[Languages.VE]: { | ||
heading: 'Chọn thông tin người đăng ký', | ||
description: 'Vui lòng chọn thông tin người đăng ký phù hợp với đối tượng.', | ||
buttons: { | ||
employer: 'Đăng ký chủ doanh nghiệp', | ||
employee: 'Đăng ký người lao động', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Languages } from '../Languages'; | ||
|
||
export const signUpModalData = { | ||
[Languages.KO]: { | ||
common: { | ||
requiredMessage: '정보를 입력해주세요.', | ||
laterMessage: '* 추후 마이페이지에서 수정 할 수 있습니다.', | ||
}, | ||
detailMessage: { | ||
employer: `이력서에 대한 정보가 필요해요.\n이력서 정보를 등록하러 가실까요?`, | ||
employee: `사업장에 대한 정보가 필요해요.\n사업주 정보를 등록하러 가실까요?`, | ||
}, | ||
buttons: { | ||
submit: '등록할게요', | ||
cancel: '괜찮아요', | ||
}, | ||
}, | ||
[Languages.VE]: { | ||
common: { | ||
requiredMessage: 'Vui lòng nhập thông tin.', | ||
laterMessage: '* Bạn có thể chỉnh sửa sau trong trang cá nhân.', | ||
}, | ||
detailMessage: { | ||
employer: `Cần thông tin về hồ sơ.\nBạn có muốn đăng ký thông tin hồ sơ không?`, | ||
employee: `Cần thông tin về doanh nghiệp.\nBạn có muốn đăng ký thông tin doanh nghiệp không?`, | ||
}, | ||
buttons: { | ||
submit: 'Tôi sẽ đăng ký', | ||
cancel: 'Không sao đâu', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Languages } from '../Languages'; | ||
|
||
export const homeData = { | ||
[Languages.KO]: { | ||
greeting: { | ||
heading: `사장님,\n 공고 등록은 하셨나요? 🤔`, | ||
button: `등록하러 가기`, | ||
}, | ||
recruitmentHeader: { | ||
heading: '어떤 일자리를 구하시나요?', | ||
description: '조건을 선택하고 원하는 일자리를 골라보세요.', | ||
}, | ||
recruitmentFilter: { | ||
all: '전체', | ||
salary: '급여순', | ||
latestRegistration: '최신등록순', | ||
}, | ||
}, | ||
[Languages.VE]: { | ||
greeting: { | ||
heading: `Sếp ơi,\n đã đăng tin tuyển dụng chưa? 🤔`, | ||
button: `Đi đăng ký`, | ||
}, | ||
recruitmentHeader: { | ||
heading: 'Bạn đang tìm công việc như thế nào?', | ||
description: 'Hãy chọn điều kiện và tìm công việc bạn muốn.', | ||
}, | ||
recruitmentFilter: { | ||
all: 'Tất cả', | ||
salary: 'Theo lương', | ||
latestRegistration: 'Mới đăng ký', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.