Skip to content

Commit 7663db8

Browse files
committed
modify: API 타입 맞춤
1 parent 0fd3816 commit 7663db8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/app/(with-tracker)/(auth-required)/main/Content.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import { useSearchParam } from '@/hooks/useSearchParam';
1717

1818
const sorts: Array<OptionType> = [
1919
['작성일순', ''],
20-
['조회순', 'daily_view_count'],
21-
['좋아요순', 'daily_like_count'],
20+
['조회순', 'dailyViewCount'],
21+
['좋아요순', 'dailyLikeCount'],
2222
];
2323

2424
export const Content = () => {
@@ -33,7 +33,7 @@ export const Content = () => {
3333
{ asc: searchParams.asc === 'true', sort: searchParams.sort || '' },
3434
pageParam,
3535
),
36-
getNextPageParam: (lastPage) => lastPage.nextCursor,
36+
getNextPageParam: (lastPage) => Number(lastPage.nextCursor.split(',')[1]),
3737
getPreviousPageParam: () => 0,
3838
initialPageParam: undefined,
3939
});

src/components/auth-required/main/Section/Graph.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const Graph = ({ id }: IProp) => {
6060
const [type, setType] = useState({
6161
start: '',
6262
end: '',
63-
type: 'view',
63+
type: 'View',
6464
});
6565

6666
const { data: datas } = useQuery({
@@ -72,7 +72,7 @@ export const Graph = ({ id }: IProp) => {
7272
{
7373
label: type.type,
7474
data: post.map(
75-
(i) => i[`daily_${type.type}_count` as keyof PostDetailValue],
75+
(i) => i[`daily${type.type}Count` as keyof PostDetailValue],
7676
),
7777
...datasets,
7878
},
@@ -108,8 +108,8 @@ export const Graph = ({ id }: IProp) => {
108108
onChange={(e) => setType({ ...type, type: e as string })}
109109
defaultValue={'조회수'}
110110
options={[
111-
['조회수', 'view'],
112-
['좋아요', 'like'],
111+
['조회수', 'View'],
112+
['좋아요', 'Like'],
113113
]}
114114
/>
115115
</div>

src/types/apis/dashboard.type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export type PostSummaryDto = {
2727

2828
export type PostDetailValue = {
2929
date: string;
30-
daily_view_count: number;
31-
daily_like_count: number;
30+
dailyViewCount: number;
31+
dailyLikeCount: number;
3232
};
3333

3434
export type PostDetailDto = {

0 commit comments

Comments
 (0)