Skip to content

Commit

Permalink
feat: 포인트 api 모두 연동
Browse files Browse the repository at this point in the history
  • Loading branch information
coddingyun committed Feb 8, 2024
1 parent 98faba4 commit b742ba9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
7 changes: 2 additions & 5 deletions src/components/organisms/point/CumulatedPointHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ import {
PointHistoryTitle,
} from '@components/molecules';
import { useGetCumulatedPoint } from '@hooks/apis/point';
//import { mockPastPointHistory } from '@mocks/pointList';

const CumulatedPointHistory = () => {
// TODO: Past Point History get api 연결
const { data: pointList } = useGetCumulatedPoint();
//const pointList = mockPastPointHistory;

const title = '역대 누적 포인트';

return (
<PointHistory>
<PointHistoryTitle title={title} />
<HistoryTotalPoint totalPoint={pointList.totalPoint} />
<PointList {...pointList} />
<HistoryTotalPoint totalPoint={String(pointList.totalPoint)} />
<PointList pointList={pointList.buyResponses} />
</PointHistory>
);
};
Expand Down
7 changes: 2 additions & 5 deletions src/components/organisms/point/ExpectedPointHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ import {
PointHistoryTitle,
} from '@components/molecules';
import { useGetExpectedPoint } from '@hooks/apis/point';
//import { mockCurrentPointHistory } from '@mocks/pointList';

const ExpectedPointHistory = () => {
// TODO: current Point History get api 연결
const { data: pointList } = useGetExpectedPoint();
//const pointList = mockCurrentPointHistory;

const title = '이번달 예상 누적 포인트';
const description =
Expand All @@ -19,8 +16,8 @@ const ExpectedPointHistory = () => {
return (
<PointHistory>
<PointHistoryTitle title={title} description={description} />
<HistoryTotalPoint totalPoint={pointList.totalPoint} />
<PointList {...pointList} />
<HistoryTotalPoint totalPoint={String(pointList.totalPoint)} />
<PointList pointList={pointList.buyResponses} />
</PointHistory>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/models/point/response/pointHistoryResponseDTO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PointHistory } from '@models/point/entity/point';
import { PointHistoryList } from '@models/point/entity/point';

export type PointHistoryResponseDTO = {
totalPoint: number;
buyResponses: PointHistory[];
buyResponses: PointHistoryList;
};

0 comments on commit b742ba9

Please sign in to comment.