Repository navigation
[Feature/#58] 워크스페이스 CRUD API 연동 #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4bb2155
feat: 워크스페이스 조회/생성 api연동
jjjsun 8072144
feat: 워크스페이스 개별조회/수정/삭제 API연동
jjjsun 81e627c
fix: 워크스페이스 API status 문자열 체크 로직 제거 및 axios 기본 에러 처리로 단순화
jjjsun 25824cc
feat: 워크스페이스 설정 저장/삭제 결과 토스트 알림 추가
jjjsun ef057eb
feat: 워크스페이스 설정 저장/삭제 토스트 알림 추가
jjjsun be5e66d
fix: 워크스페이스 생성 모달에서 미사용 상태 제거로 빌드오류 수정
jjjsun ae1a88c
chore: axios 에러 메세지 처리 공통 함수로 분리
jjjsun 1473e33
refactor: TextareaField 공통 컴포넌트 적용, disabled 속성 추가
jjjsun 2d9c282
fix: WorkspaceSetting 로고 URL 하드코딩 제거 및 상태값 적용
jjjsun fcf2d17
refactor: 워크스페이스 type id를 orgId로 통일하고 mapper 제거
jjjsun 9b8c5f0
chore: dropdownmenu 클릭가능한 영역 trigger에만 걸려있지않고, hover 배경 주는 컨테이너 자체 버튼…
jjjsun 479653c
chore: getAxiosMessage 반환타입 보장/ 워크스페이스 목록-생성 서버 상태를 React Query로 전환
jjjsun bffcd95
chore: 워크스페이스 조회 실패하면 에러 화면에 노출되도록 수정
jjjsun f96360a
fix: 코드래빗 수정사항 반영
jjjsun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,50 @@ | ||
| import { toWorkspace, toWorkspaceDetail } from "@/types/workspace/mapper"; | ||
| import type { | ||
| TApiResult, | ||
| TCreateOrgRequest, | ||
| TCreateOrgResponse, | ||
| TGetOrgResponse, | ||
| TMyOrgsData, | ||
| TUpdateWorkspaceRequest, | ||
| TWorkspace, | ||
| TWorkspaceDetail, | ||
| } from "@/types/workspace/workspace"; | ||
|
|
||
| import { axiosInstance } from "@/lib/axiosInstance"; | ||
|
|
||
| export const getMyWorkspaces = async (): Promise<TWorkspace[]> => { | ||
| const { data } = | ||
| await axiosInstance.get<TApiResult<TMyOrgsData>>("/api/org/my"); | ||
| return data.data.organizations.map(toWorkspace); | ||
| }; | ||
|
|
||
| export const createWorkspace = async ( | ||
| body: TCreateOrgRequest, | ||
| ): Promise<TCreateOrgResponse> => { | ||
| const { data } = await axiosInstance.post<TApiResult<TCreateOrgResponse>>( | ||
| "/api/org/create", | ||
| body, | ||
| ); | ||
| return data.data; | ||
| }; | ||
|
|
||
| export const getWorkspace = async ( | ||
| orgId: number, | ||
| ): Promise<TWorkspaceDetail> => { | ||
| const { data } = await axiosInstance.get<TApiResult<TGetOrgResponse>>( | ||
| `/api/org/${orgId}`, | ||
| ); | ||
|
|
||
| return toWorkspaceDetail(data.data); | ||
| }; | ||
|
|
||
| export const updateWorkspace = async ( | ||
| orgId: number, | ||
| body: TUpdateWorkspaceRequest, | ||
| ): Promise<void> => { | ||
| await axiosInstance.patch<TApiResult<string>>(`/api/org/${orgId}`, body); | ||
| }; | ||
|
|
||
| export const deleteWorkspace = async (orgId: number): Promise<void> => { | ||
| await axiosInstance.delete<TApiResult<string>>(`/api/org/${orgId}`); | ||
| }; |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.