-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: (#238) 카테고리 api 속성이 달라 발생하는 오류 수정 - api 필드 isFavorite이 favorite으로 되어있었음 * fix: 카테고리 토글에 따른 즉시 렌더링 안되는 오류 수정 - 리액트 쿼리 키에서 favorite 삭제 * fix: 댓글 수정 시 발생하는 오류 해결 - 수정된 댓글 콘텐츠만 전달하여 발생한 id 못찾는 오류를 댓글 객체 전체를 전달하는 방식으로 수정하여 해결 * fix: 글 작성자는 투표 결과를 바로 볼 수 있고 투표 할 수 없도록 수정 * feat: 통계 api response 형식 수정에 따른 반영
- Loading branch information
Showing
32 changed files
with
246 additions
and
153 deletions.
There are no files selected for viewing
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
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
19 changes: 8 additions & 11 deletions
19
frontend/src/components/VoteStatistics/OneLineGraph/index.tsx
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
25 changes: 10 additions & 15 deletions
25
frontend/src/components/VoteStatistics/TwoLineGraph/index.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,45 @@ | ||
import { Size } from '@type/style'; | ||
|
||
export interface GraphProps { | ||
voteResult: VoteResult; | ||
ageGroup: VoteDetailResult[]; | ||
size: Size; | ||
} | ||
|
||
interface VoteDetailResult { | ||
name: string; | ||
total: number; | ||
female: number; | ||
male: number; | ||
} | ||
|
||
export const AGE_OPTION = [ | ||
'underTeenager', | ||
'teenager', | ||
'twenties', | ||
'thirties', | ||
'forties', | ||
'fifties', | ||
'aboveFifties', | ||
'10대 미만', | ||
'10대', | ||
'20대', | ||
'30대', | ||
'40대', | ||
'50대', | ||
'60대 이상', | ||
] as const; | ||
|
||
export type AgeCategory = (typeof AGE_OPTION)[number]; | ||
|
||
export type VoteResultAge = Record<AgeCategory, VoteDetailResult>; | ||
export interface VoteDetailResult { | ||
name: AgeCategory; | ||
total: number; | ||
female: number; | ||
male: number; | ||
} | ||
|
||
export interface VoteResult extends VoteDetailResult { | ||
age: VoteResultAge; | ||
export interface VoteResult { | ||
ageGroup: VoteDetailResult[]; | ||
total: number; | ||
female: number; | ||
male: number; | ||
} | ||
|
||
export interface VoteDetailResultResponse { | ||
ageGroup: AgeCategory; | ||
voteCount: number; | ||
femaleCount: number; | ||
maleCount: number; | ||
} | ||
export interface VoteResultResponse { | ||
ageGroup: VoteDetailResultResponse[]; | ||
totalVoteCount: number; | ||
totalFemaleCount: number; | ||
totalMaleCount: number; | ||
} |
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,22 @@ | ||
import { VoteResult, VoteResultResponse, VoteDetailResultResponse, VoteDetailResult } from './type'; | ||
|
||
const transDetailVoteStatisticsFormat = ( | ||
voteResult: VoteDetailResultResponse | ||
): VoteDetailResult => { | ||
const { ageGroup, femaleCount, maleCount, voteCount } = voteResult; | ||
|
||
return { name: ageGroup, female: femaleCount, male: maleCount, total: voteCount }; | ||
}; | ||
|
||
export const transVoteStatisticsFormat = (voteResult: VoteResultResponse): VoteResult => { | ||
const { ageGroup, totalFemaleCount, totalMaleCount, totalVoteCount } = voteResult; | ||
|
||
const newAgeGroup = ageGroup.map(ageResult => transDetailVoteStatisticsFormat(ageResult)); | ||
|
||
return { | ||
ageGroup: newAgeGroup, | ||
female: totalFemaleCount, | ||
male: totalMaleCount, | ||
total: totalVoteCount, | ||
}; | ||
}; |
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
Oops, something went wrong.