From 1bdf9eb29b115680bfc6d57d7eaa9b67b9a08730 Mon Sep 17 00:00:00 2001 From: kangbyeonghyeon Date: Thu, 24 Oct 2024 21:39:39 +0900 Subject: [PATCH] fix: change button prop --- .env.development | 2 +- package.json | 1 + src/apis/employee/hooks/useGetMyApplication.ts | 8 ++++---- src/apis/employer/hooks/usePostNotice.ts | 7 +++---- src/features/auth/SignIn/components/SignInButton.tsx | 2 +- .../auth/SignUp/components/common/RoleModal.tsx | 4 ++-- .../companies/CompanyList/CompaniesTable/index.tsx | 2 +- src/features/home/components/Employer.tsx | 2 +- src/features/layout/Header/index.tsx | 2 +- src/pages/apply/applyguide/ApplyGuide.stories.tsx | 8 -------- .../contract/EmployerContract/EmployerContract.tsx | 8 +++----- src/types/index.d.ts | 11 +++++++++++ 12 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.env.development b/.env.development index 4ecdf12..ad2db98 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ -VITE_BASE_URL=http://localhost:5173 +VITE_BASE_URL=/ VITE_GOOGLE_AUTH_CLIENT_ID=268837811477-28b8i24r1sb0aroltho84ia6jecj74h7.apps.googleusercontent.com VITE_GOOGLE_AUTH_REDIRECT_URI=http://localhost:5173/loading \ No newline at end of file diff --git a/package.json b/package.json index ee99b1f..a5a4db4 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ }, "lint-staged": { "**/*.{tsx,ts,jsx,js}": [ + "bash -c tsc -p tsconfig.json --noEmit", "eslint --fix --cache", "prettier --write --cache" ] diff --git a/src/apis/employee/hooks/useGetMyApplication.ts b/src/apis/employee/hooks/useGetMyApplication.ts index 6fd80e2..d19caa5 100644 --- a/src/apis/employee/hooks/useGetMyApplication.ts +++ b/src/apis/employee/hooks/useGetMyApplication.ts @@ -1,13 +1,13 @@ import { APIPath } from '@/apis/apiPath'; -import { BASE_URL, fetchInstanceWithAuth } from '@/apis/instance'; +import { clientInstance } from '@/apis/instance'; import { useQuery } from '@tanstack/react-query'; -export const getMyApplicationPath = () => `${BASE_URL}${APIPath.allApplication}`; +export const getMyApplicationPath = () => `${APIPath.allApplication}`; + const myApplicationQueryKey = [getMyApplicationPath()]; export const getMyApplication = async () => { - const token = localStorage.getItem('token') ?? ''; - const response = await fetchInstanceWithAuth(token).get(getMyApplicationPath()); + const response = await clientInstance.get(getMyApplicationPath()); return response.data; }; diff --git a/src/apis/employer/hooks/usePostNotice.ts b/src/apis/employer/hooks/usePostNotice.ts index 135c275..b54af4a 100644 --- a/src/apis/employer/hooks/usePostNotice.ts +++ b/src/apis/employer/hooks/usePostNotice.ts @@ -1,5 +1,5 @@ import { APIPath } from '@/apis/apiPath'; -import { BASE_URL, fetchInstanceWithAuth } from '@/apis/instance'; +import { clientInstance } from '@/apis/instance'; import { useMutation } from '@tanstack/react-query'; export type NoticeRequestData = { @@ -19,11 +19,10 @@ export type NoticeRequestData = { companyName?: string; }; -export const getPostNoticePath = () => `${BASE_URL}${APIPath.postNotice}`; +export const getPostNoticePath = () => `${APIPath.postNotice}`; export const postNotice = async (req: NoticeRequestData) => { - const token = localStorage.getItem('token') ?? ''; - const response = await fetchInstanceWithAuth(token).post(getPostNoticePath(), req); + const response = await clientInstance.post(getPostNoticePath(), req); return response.data; }; diff --git a/src/features/auth/SignIn/components/SignInButton.tsx b/src/features/auth/SignIn/components/SignInButton.tsx index 004fcfb..3e060ab 100644 --- a/src/features/auth/SignIn/components/SignInButton.tsx +++ b/src/features/auth/SignIn/components/SignInButton.tsx @@ -8,7 +8,7 @@ export function SignInButton() { const { redirectToGoogleLogin } = useGoogleOAuth(); return ( - - diff --git a/src/features/companies/CompanyList/CompaniesTable/index.tsx b/src/features/companies/CompanyList/CompaniesTable/index.tsx index 4ff7094..4e2433a 100644 --- a/src/features/companies/CompanyList/CompaniesTable/index.tsx +++ b/src/features/companies/CompanyList/CompaniesTable/index.tsx @@ -30,7 +30,7 @@ export default function CompaniesTable({ companyList }: Props) { brand={company.brand} revenuePerYear={company.revenuePerYear} /> - diff --git a/src/features/home/components/Employer.tsx b/src/features/home/components/Employer.tsx index d1da271..89b4622 100644 --- a/src/features/home/components/Employer.tsx +++ b/src/features/home/components/Employer.tsx @@ -29,7 +29,7 @@ export default function Employer() { {`사장님,\n 공고 등록은 하셨나요? 🤔`} - + ); diff --git a/src/features/layout/Header/index.tsx b/src/features/layout/Header/index.tsx index dc5efaf..e459eeb 100644 --- a/src/features/layout/Header/index.tsx +++ b/src/features/layout/Header/index.tsx @@ -30,7 +30,7 @@ export default function Header({ profileImage }: Props) {