-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
관리자 페이지 구현 - 관리자멤버, 카테고리, 환율 관리 페이지 구현 (#790)
* feat: mock 데이터 추가 * feat: msw api 구현 * feat: category api 구현 * feat: currency api 구현 * feat: adminMember api 구현 * feat: CityPageSkeleton 구현 * feat: 카테고리 조회 페이지 구현 * feat: 카테고리 추가 모달 구현 * feat: 카테고리 수정 기능 구현 * feat: 카테고리 스켈레톤 페이지 구현 * feat: 환율 api hook 구현 * feat: 관리자 멤버 api hook 구현 * feat: 환율 조회 페이지 구현 * feat: 환율 정보 추가 모달 구현 * reafator: 컴포넌트 이름 변경 * feat: 환율 정보 수정 버튼 구현 * feat: 환율 skeleton 페이지 구현 * feat: 관리자 멤버 조회 페이지 구현 * feat: 관리자 추가 모달 구현 * feat: 비밀번호 수정 모달 구현 * refactor: style 수정 * feat: 관리자멤버 스켈레톤 페이지 구현 * refactor: import path 변경 * refactor: import 순서 리팩토링 * refactor: camelCase 적용 * refactor: pageSkeleton 제거 * refactor: style 선언 수정 * refactor: import 수정 * refactor: 매직넘버 상수화 * refactor: error 객체로 관리
- Loading branch information
Showing
125 changed files
with
4,271 additions
and
264 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
10 changes: 10 additions & 0 deletions
10
frontend-monorepo/packages/hanglog-admin/src/api/adminMember/getAdminMember.ts
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,10 @@ | ||
import type { AdminMemberData } from '@type/adminMember'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export const getAdminMember = async () => { | ||
const { data } = await axiosInstance.get<AdminMemberData[]>(END_POINTS.MEMBER); | ||
return data; | ||
}; |
18 changes: 18 additions & 0 deletions
18
frontend-monorepo/packages/hanglog-admin/src/api/adminMember/patchAdminMember.ts
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,18 @@ | ||
import type { PasswordPatchData } from '@type/adminMember'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '../axiosInstance'; | ||
|
||
export interface PatchPasswordParams extends PasswordPatchData { | ||
adminMemberId: number; | ||
} | ||
|
||
export const patchAdminMemberPassword = ( | ||
{ adminMemberId, ...passwordInformation }: PatchPasswordParams | ||
) => { | ||
return axiosInstance.patch<PasswordPatchData>( | ||
END_POINTS.CHANGE_MEMBER_PASSWORD(adminMemberId), | ||
passwordInformation | ||
); | ||
}; |
13 changes: 13 additions & 0 deletions
13
frontend-monorepo/packages/hanglog-admin/src/api/adminMember/postAdminMember.ts
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,13 @@ | ||
import type { AdminMemberPostData } from '@type/adminMember'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export const postAdminMember = async (adminMemberFormData: AdminMemberPostData) => { | ||
const response = await axiosInstance.post(END_POINTS.MEMBER, adminMemberFormData); | ||
|
||
const adminMemberId = response.headers.location.replace(`${END_POINTS.MEMBER}/`, ''); | ||
|
||
return adminMemberId; | ||
}; |
4 changes: 2 additions & 2 deletions
4
frontend-monorepo/packages/hanglog-admin/src/api/axiosInstance.ts
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
10 changes: 10 additions & 0 deletions
10
frontend-monorepo/packages/hanglog-admin/src/api/category/getCategory.ts
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,10 @@ | ||
import type { CategoryData } from '@type/category'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export const getCategory = async () => { | ||
const { data } = await axiosInstance.get<CategoryData[]>(END_POINTS.CATEGORY); | ||
return data; | ||
}; |
13 changes: 13 additions & 0 deletions
13
frontend-monorepo/packages/hanglog-admin/src/api/category/postCategory.ts
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,13 @@ | ||
import type { CategoryData } from '@type/category'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export const postCategory = async (categoryData: CategoryData) => { | ||
const response = await axiosInstance.post(END_POINTS.CATEGORY, categoryData); | ||
|
||
const categoryId = response.headers.location.replace(`${END_POINTS.CATEGORY}/`, ''); | ||
|
||
return categoryId; | ||
}; |
11 changes: 11 additions & 0 deletions
11
frontend-monorepo/packages/hanglog-admin/src/api/category/putCategeory.ts
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,11 @@ | ||
import type { CategoryData } from '@type/category'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export const putCategory = (category: CategoryData) => { | ||
return axiosInstance.put<CategoryData>(END_POINTS.CHANGE_CATEGORY(category.id), { | ||
...category, | ||
}); | ||
}; |
4 changes: 2 additions & 2 deletions
4
frontend-monorepo/packages/hanglog-admin/src/api/city/getCity.ts
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
8 changes: 4 additions & 4 deletions
8
frontend-monorepo/packages/hanglog-admin/src/api/city/postCity.ts
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,13 +1,13 @@ | ||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
import type { CityFormData } from '@type/city'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export const postCity = async (cityFormData: CityFormData) => { | ||
const response = await axiosInstance.post(END_POINTS.CITY, cityFormData); | ||
|
||
const tripId = response.headers.location.replace(`${END_POINTS.CITY}/`, ''); | ||
const cityId = response.headers.location.replace(`${END_POINTS.CITY}/`, ''); | ||
|
||
return tripId; | ||
return cityId; | ||
}; |
4 changes: 2 additions & 2 deletions
4
frontend-monorepo/packages/hanglog-admin/src/api/city/putCity.ts
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
10 changes: 10 additions & 0 deletions
10
frontend-monorepo/packages/hanglog-admin/src/api/currency/getCurrency.ts
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,10 @@ | ||
import type { CurrencyListData } from '@type/currency'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export const getCurrency = async (page: number, size: number) => { | ||
const { data } = await axiosInstance.get<CurrencyListData>(END_POINTS.CURRENCY_PAGE(page, size)); | ||
return data; | ||
}; |
13 changes: 13 additions & 0 deletions
13
frontend-monorepo/packages/hanglog-admin/src/api/currency/postCurrency.ts
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,13 @@ | ||
import type { CurrencyFormData } from '@type/currency'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export const postCurrency = async (currencyFormData: CurrencyFormData) => { | ||
const response = await axiosInstance.post(END_POINTS.CURRENCY, currencyFormData); | ||
|
||
const currencyId = response.headers.location.replace(`${END_POINTS.CURRENCY}/`, ''); | ||
|
||
return currencyId; | ||
}; |
15 changes: 15 additions & 0 deletions
15
frontend-monorepo/packages/hanglog-admin/src/api/currency/putCurrency.ts
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,15 @@ | ||
import type { CurrencyFormData } from '@type/currency'; | ||
|
||
import { END_POINTS } from '@constants/api'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
export interface PutCurrencyParams extends CurrencyFormData { | ||
currencyId: number; | ||
} | ||
|
||
export const putCurrency = ({ currencyId, ...currencyInformation }: PutCurrencyParams) => { | ||
return axiosInstance.put<CurrencyFormData>(END_POINTS.CHANGE_CURRENCY(currencyId), { | ||
...currencyInformation, | ||
}); | ||
}; |
3 changes: 2 additions & 1 deletion
3
frontend-monorepo/packages/hanglog-admin/src/api/interceptors.ts
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
42 changes: 42 additions & 0 deletions
42
...hanglog-admin/src/components/adminMember/AdminMemberAddModal/AdminMemberAddModal.style.ts
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,42 @@ | ||
import { css } from '@emotion/react'; | ||
import { Theme } from 'hang-log-design-system'; | ||
|
||
export const wrapperStyling = css({ | ||
width: '400px', | ||
minHeight: '528px', | ||
|
||
'@media screen and (max-width: 600px)': { | ||
width: `calc(100vw - ${Theme.spacer.spacing4})`, | ||
height: `80%`, | ||
}, | ||
}); | ||
|
||
export const formStyling = css({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: Theme.spacer.spacing4, | ||
width: '80%', | ||
}); | ||
|
||
export const buttonStyling = css({ | ||
width: '100%', | ||
}); | ||
|
||
export const closeButtonStyling = css({ | ||
position: 'absolute', | ||
right: Theme.spacer.spacing4, | ||
top: Theme.spacer.spacing4, | ||
alignSelf: 'flex-end', | ||
|
||
marginBottom: Theme.spacer.spacing1, | ||
|
||
border: 'none', | ||
backgroundColor: 'transparent', | ||
|
||
cursor: 'pointer', | ||
}); | ||
|
||
export const closeIconStyling = css({ | ||
width: '16px', | ||
height: '16px', | ||
}); |
Oops, something went wrong.