From 0afe4b77dd6820a74fac8fa5d471e3b2904914ad Mon Sep 17 00:00:00 2001 From: leegwae Date: Fri, 11 Aug 2023 10:49:35 +0900 Subject: [PATCH] =?UTF-8?q?refactor(api):=20api=20=EC=97=94=EB=93=9C?= =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A0=95=EC=9D=98=ED=95=9C=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/api/__tests__/panel.ts | 2 +- src/lib/api/auth.ts | 2 +- src/lib/{apiUrl.ts => api/consts.ts} | 0 src/lib/api/panel.ts | 2 +- src/mocks/handlers/auth.ts | 2 +- src/mocks/handlers/panel.ts | 2 +- src/pages/__tests__/Login.test.tsx | 2 +- src/pages/__tests__/SignUp.test.tsx | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename src/lib/{apiUrl.ts => api/consts.ts} (100%) diff --git a/src/lib/api/__tests__/panel.ts b/src/lib/api/__tests__/panel.ts index 2a4fdffd..206b26f6 100644 --- a/src/lib/api/__tests__/panel.ts +++ b/src/lib/api/__tests__/panel.ts @@ -1,5 +1,5 @@ +import { apiUrl } from '@/lib/api/consts'; import { createPanel, type CreatePanelBody } from '@/lib/api/panel'; -import { apiUrl } from '@/lib/apiUrl'; describe('panel api', () => { it(`createPanel을 호출하면 패널 생성 API(${apiUrl.panel.create()})로 요청한다`, async () => { diff --git a/src/lib/api/auth.ts b/src/lib/api/auth.ts index 005245ff..55f1c7e6 100644 --- a/src/lib/api/auth.ts +++ b/src/lib/api/auth.ts @@ -1,7 +1,7 @@ import type { SuccessResponse, ErrorResponse } from '@/lib/api/types'; +import { apiUrl } from '@/lib/api/consts'; import { apiClient } from '@/lib/apiClient'; -import { apiUrl } from '@/lib/apiUrl'; export const signUp = async (body: SignUpBody): Promise => apiClient diff --git a/src/lib/apiUrl.ts b/src/lib/api/consts.ts similarity index 100% rename from src/lib/apiUrl.ts rename to src/lib/api/consts.ts diff --git a/src/lib/api/panel.ts b/src/lib/api/panel.ts index 7b041e5b..134556fc 100644 --- a/src/lib/api/panel.ts +++ b/src/lib/api/panel.ts @@ -6,8 +6,8 @@ import type { GetMyPanelsResult, } from '@/mocks/handlers/panel'; +import { apiUrl } from '@/lib/api/consts'; import { apiClient } from '@/lib/apiClient'; -import { apiUrl } from '@/lib/apiUrl'; export const getMyPanels = async ( params: GetMyPanelsParams, diff --git a/src/mocks/handlers/auth.ts b/src/mocks/handlers/auth.ts index bce2f25d..77558324 100644 --- a/src/mocks/handlers/auth.ts +++ b/src/mocks/handlers/auth.ts @@ -12,8 +12,8 @@ import type { ErrorResponse } from '@/lib/api/types'; import { rest } from 'msw'; +import { apiUrl } from '@/lib/api/consts'; import { API_BASE_URL } from '@/lib/apiClient'; -import { apiUrl } from '@/lib/apiUrl'; import { myAccount } from '@/mocks/data/auth'; export const signUp = rest.post( diff --git a/src/mocks/handlers/panel.ts b/src/mocks/handlers/panel.ts index 825b60db..87dcdb7a 100644 --- a/src/mocks/handlers/panel.ts +++ b/src/mocks/handlers/panel.ts @@ -8,8 +8,8 @@ import type { SuccessResponse } from '@/lib/api/types'; import { faker } from '@faker-js/faker'; import { rest } from 'msw'; +import { apiUrl } from '@/lib/api/consts'; import { API_BASE_URL } from '@/lib/apiClient'; -import { apiUrl } from '@/lib/apiUrl'; import { myPanelList } from '@/mocks/data/panel'; export interface GetMyPanelsParams { diff --git a/src/pages/__tests__/Login.test.tsx b/src/pages/__tests__/Login.test.tsx index 471810ee..58f68ff5 100644 --- a/src/pages/__tests__/Login.test.tsx +++ b/src/pages/__tests__/Login.test.tsx @@ -8,7 +8,7 @@ import { rest } from 'msw'; import { MemoryRouter } from 'react-router-dom'; import * as apis from '@/lib/api/auth'; -import { apiUrl } from '@/lib/apiUrl'; +import { apiUrl } from '@/lib/api/consts'; import { renderWithQueryClient } from '@/lib/test-utils'; import { server } from '@/mocks/server'; import { Login } from '@/pages/Login'; diff --git a/src/pages/__tests__/SignUp.test.tsx b/src/pages/__tests__/SignUp.test.tsx index f8648f0d..e9daec63 100644 --- a/src/pages/__tests__/SignUp.test.tsx +++ b/src/pages/__tests__/SignUp.test.tsx @@ -8,7 +8,7 @@ import { rest } from 'msw'; import { MemoryRouter } from 'react-router-dom'; import * as apis from '@/lib/api/auth'; -import { apiUrl } from '@/lib/apiUrl'; +import { apiUrl } from '@/lib/api/consts'; import { renderWithQueryClient } from '@/lib/test-utils'; import { server } from '@/mocks/server'; import { SignUp } from '@/pages/SignUp';