Skip to content

Commit

Permalink
Develop client (#211)
Browse files Browse the repository at this point in the history
* feat: ๋ถˆํ•„์š”ํ•˜๊ฒŒ ๋ถ„๋ฆฌ๋œ ์ปดํฐ๋„ŒํŠธ ์ œ๊ฑฐ

* design: ์Šฌ๋ผ์ด๋” UI์ˆ˜์ • ๋ฐ ๋ชจ๋ฐ”์ผ ๋Œ€์‘

* design: ๋กœ๋“œ๋งต ๋””ํ…Œ์ผ ํŽ˜์ด์ง€ UI์ˆ˜์ • ๋ฐ ๋ชจ๋ฐ”์ผ ๋Œ€์‘

* feat: ๋ชจ์ง‘์ค‘์ธ ๊ณจ๋ฃธ์ด ์กด์žฌํ•˜์ง€ ์•Š์„ ๋•Œ ๋Œ€์ฒด UI ํ‘œ์‹œ

* refactor: console.log ์ผ๊ด„ ์ œ๊ฑฐ

* chore: class์ปดํฌ๋„ŒํŠธ ์‚ฌ์šฉ์„ ์œ„ํ•œ ์„ค์ • ์ถ”๊ฐ€

* feat: critical errorBoudnary ์ ์šฉ

* refactor: errorboundary reset๋ฉ”์„œ๋“œ ์ˆ˜์ •

* feat: API์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ƒ์„ฑ

* feat: Network์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ƒ์„ฑ

* feat: Runtime์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ƒ์„ฑ

* feat: Critical์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ƒ์„ฑ

* feat: Base์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ƒ์„ฑ

* feat: Async์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ƒ์„ฑ

* feat: ์ปค์Šคํ…€  ์—๋Ÿฌ ์ƒ์„ฑ๋กœ์ง ๊ตฌํ˜„

* refactor: ๋ถˆํ•„์š”ํ•œ ์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ œ๊ฑฐ

* refactor: ์—๋ฒ„๋ฐ”์šด๋”๋ฆฌ props & state ํƒ€์ž… ์ˆ˜์ •

* feat: ์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ ์šฉ

* build: react-lightweight-form ์„ค์น˜

* refactor: ๋กœ๊ทธ์ธ, ํšŒ์›๊ฐ€์ž… Form์— react-lightweight-form ์ ์šฉ

* build: react-lightweight-form v1.2.5๋กœ ์—…๋ฐ์ดํŠธ

* refactor: ์•„์ด๋””์™€ ๋น„๋ฐ€๋ฒˆํ˜ธ ํ•„๋“œ์— ๋Œ€ํ•ด required ์†์„ฑ ์ ์šฉ

* fix: babelํ”Œ๋Ÿฌ๊ทธ์ธ ํ™œ์„ฑํ™”

* refactor: ๋ถˆํ•„์š”ํ•œ suspense ์ œ๊ฑฐ

* feat: ์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ fallbackUI์ƒ์„ฑ ๋ฐ ์ถ”๊ฐ€

* feat: ์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ์— callback props์ถ”๊ฐ€

* refactor: onError callback์„ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋กœ์ง ๋ณ€๊ฒฝ

* style: ErrorBoundarySharedProps ํƒ€์ž… export

* [feat/CK-233] ๋ฐ์ดํ„ฐ ํ†ต์‹ ๋กœ์ง ๋ฆฌํŒฉํ† ๋ง & mutate์‹œ์— ์—๋Ÿฌ ํ•ธ๋“ค๋ง์„ ์ ์šฉํ•œ๋‹ค (#195)

* refactor:  api๊ฒฝ๋กœ ์ถ”์ƒํ™”

* chore: ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ํŒŒ์ผ ์‚ญ์ œ

* design: ํ† ์ŠคํŠธ ์•„์ด์ฝ˜ ์‚ฝ์ž…

* refactor: toast ๊ฒฝ๋กœ๋ณ€๊ฒฝ

* refactor: mutation queryclient ์ œ๊ฑฐ

* design: toast ๋””์ž์ธ ๋ณ€๊ฒฝ

* feat: toast context ๋ถ„๋ฆฌ ๋ฐ ํŒŒ์ผ๋ช… ๋ณ€๊ฒฝ

* feat: useMutationWithKey ๊ตฌํ˜„

* feat: useMutationWithKey ์ ์šฉ

* feat: useMutationWithKey ์ ์šฉ

* feat: toast contents ์ƒ์ˆ˜ํ™”

* [feat/CK-243] ๊ณตํ†ต์ปดํฌ๋„ŒํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ ์šฉํ•œ๋‹ค (#208)

* chore: ck-util-component ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜

* refactor: roadmap create select์ปดํฌ๋„ŒํŠธ ์œ ํ‹ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* refactor: goalroom filter select์ปดํฌ๋„ŒํŠธ ์œ ํ‹ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* refactor: ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ ์ œ๊ฑฐ

* refactor: roadmap create ๋‚œ์ด๋„ select์ปดํฌ๋„ŒํŠธ ์œ ํ‹ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* feat: invariantType ํ•จ์ˆ˜ ์ถ”๊ฐ€

* refactor: roadmap search select์ปดํฌ๋„ŒํŠธ ์œ ํ‹ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* chore: ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ ์ œ๊ฑฐ

* chore: ck-util-components version update

* refactor: goalroomDashboard modal ์ปดํฌ๋„ŒํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* chore: ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๋ชจ๋“ˆ ์ œ๊ฑฐ

* chore: ck-util-components version update

* [feat/CK-244] ์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•˜๊ณ , ๊ณจ๋ฃจ ๋Œ€์‹œ๋ณด๋“œ์— ์ ์šฉํ•œ๋‹ค (#210)

* chore: ck-util-component ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜

* refactor: roadmap create select์ปดํฌ๋„ŒํŠธ ์œ ํ‹ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* refactor: goalroom filter select์ปดํฌ๋„ŒํŠธ ์œ ํ‹ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* refactor: ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ ์ œ๊ฑฐ

* refactor: roadmap create ๋‚œ์ด๋„ select์ปดํฌ๋„ŒํŠธ ์œ ํ‹ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* feat: invariantType ํ•จ์ˆ˜ ์ถ”๊ฐ€

* refactor: roadmap search select์ปดํฌ๋„ŒํŠธ ์œ ํ‹ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* chore: ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ ์ œ๊ฑฐ

* chore: ck-util-components version update

* refactor: goalroomDashboard modal ์ปดํฌ๋„ŒํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ ์šฉ

* chore: ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๋ชจ๋“ˆ ์ œ๊ฑฐ

* chore: ck-util-components version update

* fix: lazy suspense ์ ์šฉ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

* refactor: ๋ฐ์ดํ„ฐ ํŒจ์นญ ์˜์กด์„ฑ ๋ถ„๋ฆฌ

* feat: goalroomDashboard ์—๋Ÿฌ๋ฐ”์šด๋”๋ฆฌ ์ ์šฉ

---------

Co-authored-by: Jungwoo <[email protected]>
Co-authored-by: ๋ถ€์—‰์ด <[email protected]>
Co-authored-by: Woody <[email protected]>
  • Loading branch information
4 people authored Mar 29, 2024
1 parent 9e8a4a8 commit 6e7b00b
Show file tree
Hide file tree
Showing 79 changed files with 1,249 additions and 1,046 deletions.
8 changes: 7 additions & 1 deletion client/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"displayName": true
}
],
"@babel/plugin-transform-runtime"
"@babel/plugin-transform-runtime",
[
"babel-plugin-transform-builtin-extend",
{
"globals": ["Error", "Array"]
}
]
]
}
3 changes: 3 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
"@tanstack/react-query-devtools": "^4.29.19",
"ajv": "^8.12.0",
"axios": "^1.4.0",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"ck-util-components": "^1.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-lightweight-form": "^1.2.5",
"react-router-dom": "^6.14.1",
"styled-components": "^6.0.0"
},
Expand Down
35 changes: 19 additions & 16 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import SignUpPage from '@pages/signUpPage/SignUpPage';
import LoginPage from '@pages/loginPage/LoginPage';
import PageLayout from '@components/_common/pageLayout/PageLayout';
import RoadmapListPage from '@pages/roadmapListPage/roadmapListPage';
import Fallback from '@components/_common/fallback/Fallback';
import RoadmapDetailPage from './pages/roadmapDetailPage/RoadmapDetailPage';
import RoadmapCreatePage from './pages/roadmapCreatePage/RoadmapCreatePage';
import ToastProvider from '@components/_common/toastProvider/ToastProvider';
import ToastProvider from '@/components/_common/toast/Toast';
import MyPage from '@pages/myPage/MyPage';
import UserInfoProvider from './components/_providers/UserInfoProvider';
import RoadmapSearchResult from './components/roadmapListPage/roadmapSearch/RoadmapSearchResult';
import MainPage from '@pages/mainPage/MainPage';
import OAuthRedirect from './components/loginPage/OAuthRedirect';
import AsyncBoundary from './components/_common/errorBoundary/AsyncBoundary';
import SessionHandler from '@components/_common/sessionHandler/SessionHandler';
import RouteChangeTracker from '@components/_common/routeChangeTracker/RouteChangeTracker';
import PrivateRouter from '@components/_common/privateRouter/PrivateRouter';
import { Spinner } from './components/_common/spinner/Spinner.styles';
import { CriticalErrorBoundary } from './components/_common/errorBoundary/CriticalErrorBoundary';

const GoalRoomDashboardPage = lazy(
() => import('@pages/goalRoomDashboardPage/GoalRoomDashboardPage')
Expand All @@ -40,8 +40,8 @@ const App = () => {
<RouteChangeTracker>
<ResponsiveContainer>
<PageLayout>
<AsyncBoundary>
<SessionHandler>
<SessionHandler>
<CriticalErrorBoundary>
<Routes>
<Route path='/' element={<MainPage />} />
<Route path='/login' element={<LoginPage />} />
Expand All @@ -52,18 +52,15 @@ const App = () => {
element={<RoadmapSearchResult />}
/>
</Route>
<Route path='/roadmap/:id' element={<RoadmapDetailPage />} />
<Route
path='/roadmap/:id'
path='/roadmap/:id/goalroom-list'
element={
<Suspense fallback={<Fallback />}>
<RoadmapDetailPage />
<Suspense fallback={<Spinner />}>
<GoalRoomListPage />
</Suspense>
}
/>
<Route
path='/roadmap/:id/goalroom-list'
element={<GoalRoomListPage />}
/>
<Route
path='/roadmap-create'
element={
Expand All @@ -76,13 +73,19 @@ const App = () => {
path='/roadmap/:id/goalroom-create'
element={
<PrivateRouter>
<GoalRoomCreatePage />
<Suspense fallback={<Spinner />}>
<GoalRoomCreatePage />
</Suspense>
</PrivateRouter>
}
/>
<Route
path='/goalroom-dashboard/:goalroomId'
element={<GoalRoomDashboardPage />}
element={
<Suspense fallback={<Spinner />}>
<GoalRoomDashboardPage />
</Suspense>
}
/>
<Route
path='/myPage'
Expand All @@ -94,8 +97,8 @@ const App = () => {
/>
<Route path='/oauth/redirect' element={<OAuthRedirect />} />
</Routes>
</SessionHandler>
</AsyncBoundary>
</CriticalErrorBoundary>
</SessionHandler>
</PageLayout>
</ResponsiveContainer>
</RouteChangeTracker>
Expand Down
33 changes: 17 additions & 16 deletions client/src/apis/goalRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '@/myTypes/goalRoom/remote';
import client from '@apis/axios/client';
import { GoalRoomRecruitmentStatus, MyPageGoalRoom } from '@myTypes/goalRoom/internal';
import { API_PATH } from '@/constants/_common/api';

export const getGoalRoomList = async ({
roadmapId,
Expand All @@ -24,7 +25,7 @@ export const getGoalRoomList = async ({
lastId,
}: GoalRoomListRequest): Promise<GoalRoomDetailResponse> => {
const { data } = await client.get<GoalRoomDetailResponse>(
`/roadmaps/${roadmapId}/goal-rooms`,
API_PATH.GOALROOMS(roadmapId),
{
params: {
...(lastId && { lastId }),
Expand All @@ -39,36 +40,36 @@ export const getGoalRoomList = async ({
};

export const getMyGoalRoomList = async (statusCond: GoalRoomRecruitmentStatus) => {
const { data } = await client.get<MyPageGoalRoom[]>(
`/goal-rooms/me?statusCond=${statusCond}`
);
const { data } = await client.get<MyPageGoalRoom[]>(API_PATH.MY_GOALROOMS(statusCond));

return data;
};

export const getGoalRoomDetail = async (
goalRoomId: number
): Promise<GoalRoomInfoResponse> => {
const { data } = await client.get<GoalRoomInfoResponse>(`/goal-rooms/${goalRoomId}`);
const { data } = await client.get<GoalRoomInfoResponse>(
API_PATH.GOALROOM_DETAIL(goalRoomId)
);
return data;
};

export const getGoalRoomDashboard = async (goalRoomId: string) => {
const { data } = await client.get<GoalRoomBrowseResponse>(
`/goal-rooms/${goalRoomId}/me`
API_PATH.GOALROOM_DASHBOARD(goalRoomId)
);
return data;
};

export const postCreateGoalRoom = async (body: CreateGoalRoomRequest) => {
const { data } = await client.post(`/goal-rooms`, body);
const { data } = await client.post(API_PATH.CREATE_GOALROOM, body);

return data;
};

export const getGoalRoomTodos = async (goalRoomId: string) => {
const { data } = await client.get<GoalRoomTodoResponse>(
`/goal-rooms/${goalRoomId}/todos`
`${API_PATH.GOALROOM_TODOS(goalRoomId)}/90`
);

return data;
Expand All @@ -78,34 +79,34 @@ export const postToChangeTodoCheckStatus = async ({
goalRoomId,
todoId,
}: GoalRoomTodoChangeStatusRequest) => {
return client.post(`/goal-rooms/${goalRoomId}/todos/${todoId}`);
return client.post(API_PATH.CHANGE_TODO_CHECKS(goalRoomId, todoId));
};

export const postCreateNewTodo = (goalRoomId: string, body: newTodoPayload) => {
return client.post(`/goal-rooms/${goalRoomId}/todos`, body);
return client.post(API_PATH.CREATE_TODO(goalRoomId), body);
};

export const postCreateNewCertificationFeed = (
goalRoomId: string,
formData: FormData
) => {
return client.post(`/goal-rooms/${goalRoomId}/checkFeeds`, formData, {
return client.post(API_PATH.CREATE_FEED(goalRoomId), formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
});
};

export const postJoinGoalRoom = (goalRoomId: string) => {
return client.post(`/goal-rooms/${goalRoomId}/join`);
return client.post(API_PATH.JOIN_GOALROOM(goalRoomId));
};

export const getGoalRoomParticipants = async (
goalRoomId: string,
participantsSortOrder: ParticipantsSortOrder
) => {
const { data } = await client.get<GoalRoomParticipantsResponse>(
`/goal-rooms/${goalRoomId}/members`,
API_PATH.GOALROOM_PARTICIPANTS(goalRoomId),
{
params: {
sortCond: participantsSortOrder,
Expand All @@ -118,19 +119,19 @@ export const getGoalRoomParticipants = async (

export const getCertificationFeeds = async (goalRoomId: string) => {
const { data } = await client.get<GoalRoomCertificationFeedsResponse>(
`/goal-rooms/${goalRoomId}/checkFeeds`
API_PATH.GOALROOM_FEEDS(goalRoomId)
);

return data;
};

export const postStartGoalRoom = async (goalRoomId: string) => {
return client.post(`/goal-rooms/${goalRoomId}/start`);
return client.post(API_PATH.START_GOALROOM(goalRoomId));
};

export const getGoalRoomNodeList = async (goalRoomId: string) => {
const { data } = await client.get<GoalRoomNodeListResponse>(
`/goal-rooms/${goalRoomId}/nodes`
API_PATH.GOALROOM_NODE_LIST(goalRoomId)
);
return data;
};
23 changes: 14 additions & 9 deletions client/src/apis/roadmap.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { API_PATH } from '@/constants/_common/api';
import type {
RoadmapDetailResponse,
RoadmapListRequest,
Expand All @@ -12,7 +13,7 @@ export const getRoadmapList = async ({
filterCond,
lastId,
}: RoadmapListRequest) => {
const { data } = await client.get<RoadmapListResponse>(`/roadmaps`, {
const { data } = await client.get<RoadmapListResponse>(API_PATH.ROADMAPS, {
params: {
...(categoryId && { categoryId }),
...(lastId && { lastId }),
Expand All @@ -31,7 +32,7 @@ export const getSearchRoadmapList = async ({
lastId = '',
size = 10,
}: any) => {
const { data } = await client.get<RoadmapListResponse>(`/roadmaps/search`, {
const { data } = await client.get<RoadmapListResponse>(API_PATH.ROADMAP_SEARCH, {
params: {
[category]: search,
filterCond,
Expand All @@ -44,22 +45,26 @@ export const getSearchRoadmapList = async ({
};

export const getRoadmapDetail = async (id: number): Promise<RoadmapDetailResponse> => {
const { data } = await client.get<RoadmapDetailResponse>(`/roadmaps/${id}`);
const { data } = await client.get<RoadmapDetailResponse>(API_PATH.ROADMAP_DETAIL(id));

return data;
};

export const postCreateRoadmap = (roadmapValue: FormData) => {
const resposne = client.post<RoadmapValueRequest>('/roadmaps', roadmapValue, {
headers: {
'Content-Type': 'multipart/form-data;charset=UTF-8',
},
});
const resposne = client.post<RoadmapValueRequest>(
API_PATH.CREATE_ROADMAP,
roadmapValue,
{
headers: {
'Content-Type': 'multipart/form-data;charset=UTF-8',
},
}
);
return resposne;
};

export const getMyRoadmapList = async (size: number, lastId?: number) => {
const { data } = await client.get<RoadmapListResponse>('/roadmaps/me', {
const { data } = await client.get<RoadmapListResponse>(API_PATH.MY_ROADMAPS, {
params: {
size,
...(lastId && { lastId }),
Expand Down
13 changes: 8 additions & 5 deletions client/src/apis/user.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { API_PATH } from '@/constants/_common/api';
import client from '@apis/axios/client';
import {
MemberJoinRequest,
Expand All @@ -9,17 +10,19 @@ import {
} from '@myTypes/user/remote';

export const signUp = (body: MemberJoinRequest) => {
return client.post('/members/join', body);
return client.post(API_PATH.SIGN_UP, body);
};

export const getNaverLoginRedirectUrl = async () => {
const { data } = await client.get<NaverLoginRedirectResponse>('/auth/oauth/naver');
const { data } = await client.get<NaverLoginRedirectResponse>(
API_PATH.NAVER_LOGIN_REDIRECT
);

return data;
};

export const naverOAuthToken = async (code: string, state: string) => {
const { data } = await client.get<OAuthResponse>('/auth/login/oauth', {
const { data } = await client.get<OAuthResponse>(API_PATH.NAVER_TOKEN, {
params: {
code,
state,
Expand All @@ -30,11 +33,11 @@ export const naverOAuthToken = async (code: string, state: string) => {
};

export const login = (body: UserLoginRequest) => {
return client.post<UserLoginResponse>('/auth/login', body);
return client.post<UserLoginResponse>(API_PATH.LOGIN, body);
};

export const getUserInfo = (signal?: AbortSignal) => {
return client.get<UserInfoResponse>('/members/me', {
return client.get<UserInfoResponse>(API_PATH.USER_INFO, {
signal,
});
};
Empty file removed client/src/assets/icons/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions client/src/assets/icons/errorToastButton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/assets/icons/successToastButton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/assets/icons/warningToastButton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6e7b00b

Please sign in to comment.