-
Notifications
You must be signed in to change notification settings - Fork 0
캐릭터 도감 / 모임원 조회 / 참여자 선택 실제 API 연결 #31
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 all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
578900b
feat: 캐릭터 도감 실제 API 연결
yoouyeon 57bff48
feat: 정산 참여자 조회(모임원 조회) 실제 API 연결
yoouyeon ce6e6b6
feat: 참여자 선택 실제 API 연결
yoouyeon e40c99c
refactor: 더 이상 사용되지 않는 MemberProfileData 타입 제거
yoouyeon 425fe34
refactor: 캐릭터 데이터를 CHARACTER_DATA로 통합
yoouyeon a8b73df
refactor: 사용하지 않던 collections wrapper 제거
yoouyeon e59b17c
refactor: parseDate 헬퍼로 Date 변환 통일
yoouyeon 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 |
|---|---|---|
| @@ -1,9 +1,14 @@ | ||
| import axiosInstance from '@/shared/api/axios'; | ||
| import { CharacterItemsResponse } from '../model/character.type'; | ||
| import { parseDate } from '@/shared/lib/parseDate'; | ||
| import { | ||
| CharacterItemData, | ||
| CharacterItemsRawResponse, | ||
| } from '../model/character.type'; | ||
|
|
||
| export const getCharacterCollection = () => | ||
| axiosInstance | ||
| .get<CharacterItemsResponse>('/character/collection', { | ||
| useMock: true, | ||
| }) | ||
| .then((res) => res.data); | ||
| export const getCharacterCollection = (): Promise<CharacterItemData[]> => | ||
| axiosInstance.get<CharacterItemsRawResponse>('/collections').then((res) => | ||
| res.data.collections.map((item) => ({ | ||
| ...item, | ||
| acquiredAt: parseDate(item.acquiredAt), | ||
| })) | ||
| ); | ||
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 |
|---|---|---|
| @@ -1,65 +1,46 @@ | ||
| import { CharacterType } from '@/entities/character/model/character.type'; | ||
|
|
||
| export const CHARACTER_IMAGE_SIZE: Record< | ||
| CharacterType, | ||
| { | ||
| big: { | ||
| width?: string; | ||
| height?: string; | ||
| }; | ||
| small: { | ||
| width?: string; | ||
| height?: string; | ||
| }; | ||
| } | ||
| > = { | ||
| export const CHARACTER_DATA = { | ||
| '천사 모또': { | ||
| big: { | ||
| width: '15rem', | ||
| }, | ||
| small: { | ||
| width: '12rem', | ||
| imageSize: { | ||
| big: { width: '15rem' }, | ||
| small: { width: '12rem' }, | ||
| }, | ||
| description: '정산의 수호천사 등장!', | ||
| }, | ||
| '러키 모또': { | ||
| big: { | ||
| width: '12.5rem', | ||
| }, | ||
| small: { | ||
| width: '10rem', | ||
| imageSize: { | ||
| big: { width: '12.5rem' }, | ||
| small: { width: '10rem' }, | ||
| }, | ||
| description: '정산 성공! 좋은 일만 가득하길~', | ||
| }, | ||
| '딸기 또또': { | ||
| big: { | ||
| width: '12.5rem', | ||
| }, | ||
| small: { | ||
| width: '10rem', | ||
| height: '10rem', | ||
| imageSize: { | ||
| big: { width: '12.5rem' }, | ||
| small: { width: '10rem', height: '10rem' }, | ||
| }, | ||
| description: '정산 완료! 달콤한 하루 보내~', | ||
| }, | ||
| '잠꾸러기 또또': { | ||
| big: { | ||
| width: '12.5rem', | ||
| }, | ||
| small: { | ||
| width: '10rem', | ||
| imageSize: { | ||
| big: { width: '12.5rem' }, | ||
| small: { width: '10rem' }, | ||
| }, | ||
| description: '정산 끝났어? 이제 푹 잘 수 있겠네~', | ||
| }, | ||
| '마법사 또또': { | ||
| big: { | ||
| height: '13.72844rem', | ||
| }, | ||
| small: { | ||
| height: '10.98275rem', | ||
| imageSize: { | ||
| big: { height: '13.72844rem' }, | ||
| small: { height: '10.98275rem' }, | ||
| }, | ||
| description: '정산? 아브라카다브라! 해결 완료~', | ||
| }, | ||
| }; | ||
|
|
||
| export const CHARACTER_DESCRIPTION: Record<CharacterType, string> = { | ||
| '천사 모또': '정산의 수호천사 등장!', | ||
| '러키 모또': '정산 성공! 좋은 일만 가득하길~', | ||
| '딸기 또또': '정산 완료! 달콤한 하루 보내~', | ||
| '잠꾸러기 또또': '정산 끝났어? 이제 푹 잘 수 있겠네~', | ||
| '마법사 또또': '정산? 아브라카다브라! 해결 완료~', | ||
| }; | ||
| } satisfies Record< | ||
| string, | ||
| { | ||
| imageSize: { | ||
| big: { width?: string; height?: string }; | ||
| small: { width?: string; height?: string }; | ||
| }; | ||
| description: string; | ||
| } | ||
| >; |
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
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 |
|---|---|---|
| @@ -1,15 +1,18 @@ | ||
| import axiosInstance from '@/shared/api/axios'; | ||
| import { parseDate } from '@/shared/lib/parseDate'; | ||
| import { MemberProfile, MemberProfileRaw } from '../model/member.type'; | ||
|
|
||
| // 참여자 선택 api (로그인한 참여자가 정산에 참여하도록 프로필 설정) | ||
| export const assignMember = async ( | ||
| settlementCode: string, | ||
| memberId: number | ||
| ): Promise<void> => { | ||
| await axiosInstance.post( | ||
| ): Promise<MemberProfile> => { | ||
| const response = await axiosInstance.post<MemberProfileRaw>( | ||
| `/groups/${settlementCode}/members/assign`, | ||
| { | ||
| memberId, | ||
| }, | ||
| { useMock: true } | ||
| { memberId } | ||
| ); | ||
| return { | ||
| ...response.data, | ||
| paidAt: parseDate(response.data.paidAt), | ||
| }; | ||
| }; |
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 |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| import axiosInstance from '@/shared/api/axios'; | ||
| import { MemberProfile, MemberProfileData } from '../model/member.type'; | ||
| import { parseDate } from '@/shared/lib/parseDate'; | ||
| import { MemberProfile, MemberProfileRawData } from '../model/member.type'; | ||
|
|
||
| // TODO : 기존 groupToken들을 사용하는 방식을 settlementCode를 사용하는 방식으로 변경해야 함. | ||
| // 모임원 조회 API - 정산 참여자 프로필 조회 | ||
| export const getProfiles = async ( | ||
| settlementCode: string | ||
| ): Promise<MemberProfile[]> => { | ||
| const response = await axiosInstance.get<MemberProfileData>( | ||
| `/groups/${settlementCode}/members`, | ||
| { useMock: true } | ||
| const response = await axiosInstance.get<MemberProfileRawData>( | ||
| `/groups/${settlementCode}/members` | ||
| ); | ||
| return response.data.members; | ||
| return response.data.members.map((member) => ({ | ||
| ...member, | ||
| paidAt: parseDate(member.paidAt), | ||
| })); | ||
| }; |
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
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
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
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
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
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
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.