Skip to content

Commit 06bad95

Browse files
authored
Merge pull request #158 from eureca-final-capstone-project/dev
[VT2-284] chore: 25차 배포
2 parents fb52357 + 9dd812e commit 06bad95

4 files changed

Lines changed: 4 additions & 28 deletions

File tree

src/components/Graph/Graph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { useDeviceType } from '../../hooks/useDeviceType'
1414
import EndOfFeedMessage from '../../pages/PostPage/components/EndOfFeedMessage'
1515

1616
interface DataPoint {
17-
[key: string]: string | number
17+
[key: string]: string | number | null
1818
}
1919

2020
interface GraphProps {

src/pages/AdminPage/components/PriceGraph.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,7 @@ const PriceGraph = () => {
1010
queryFn: getHourlyStatistics,
1111
})
1212

13-
const graphData = statistics
14-
? transformToGraphData(statistics).map(entry => {
15-
const newEntry: Record<string, number> = {}
16-
Object.entries(entry).forEach(([key, value]) => {
17-
if (value !== null) newEntry[key] = value
18-
})
19-
return newEntry
20-
})
21-
: []
13+
const graphData = statistics ? transformToGraphData(statistics) : []
2214

2315
return (
2416
<section className="flex flex-col gap-5">

src/pages/DetailPage/components/PriceGraph.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@ const PriceGraph = () => {
99
queryFn: getHourlyStatistics,
1010
})
1111

12-
const graphData = statistics
13-
? transformToGraphData(statistics).map(entry => {
14-
const newEntry: Record<string, number> = {}
15-
Object.entries(entry).forEach(([key, value]) => {
16-
if (value !== null) newEntry[key] = value
17-
})
18-
return newEntry
19-
})
20-
: []
12+
const graphData = statistics ? transformToGraphData(statistics) : []
2113

2214
return (
2315
<section className="bg-gray-10 flex w-full flex-col gap-4 sm:bg-transparent md:gap-10">

src/pages/MainPage/index.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,7 @@ const MainPage = () => {
3030
queryFn: getHourlyStatistics,
3131
})
3232

33-
const graphData = statistics
34-
? transformToGraphData(statistics).map(entry => {
35-
const newEntry: Record<string, number> = {}
36-
Object.entries(entry).forEach(([key, value]) => {
37-
if (value !== null) newEntry[key] = value
38-
})
39-
return newEntry
40-
})
41-
: []
33+
const graphData = statistics ? transformToGraphData(statistics) : []
4234

4335
const { isModalOpen, setIsModalOpen } = useShowPermissionModal()
4436

0 commit comments

Comments
 (0)