diff --git a/app/record/[id].tsx b/app/record/[id].tsx index 3e7228d..da9f18e 100644 --- a/app/record/[id].tsx +++ b/app/record/[id].tsx @@ -272,9 +272,9 @@ export default function RecordScreen() { {/* 통계 */} {[ - { label: "소요시간", value: "3시간 24분" }, - { label: "고도", value: "642m" }, - { label: "칼로리", value: "1128kcal" }, + { label: "소요시간", value: formatDuration(recordDetail?.durationSeconds ?? durationSec) }, + { label: "고도", value: recordDetail?.ascentMeters != null ? `${Math.round(recordDetail.ascentMeters)}Nm` : "--" }, + { label: "칼로리", value: recordDetail?.calories != null ? `${recordDetail.calories}kcal` : "--" }, ].map((stat) => ( {stat.label} diff --git a/features/tracking/hooks/use-clive-photos.ts b/features/tracking/hooks/use-clive-photos.ts index 722d357..f1302bd 100644 --- a/features/tracking/hooks/use-clive-photos.ts +++ b/features/tracking/hooks/use-clive-photos.ts @@ -2,15 +2,27 @@ import { useQuery } from "@tanstack/react-query"; import { api } from "@/lib/api"; import { ENDPOINTS } from "@/types/api.generated"; +type ClivePhoto = { + photoId: number; + trackingSessionId: number; + milestoneIndex: number; + milestoneDistanceM: number; + imageUrl: string; + capturedAt: string; + lat: number; + lng: number; + altitude: number; +}; + export function useClivePhotos(sessionId: number | null) { return useQuery({ queryKey: ["clivePhotos", sessionId], enabled: sessionId != null, queryFn: async () => { - const res = await api.get({ - path: `${ENDPOINTS.DEMO_TRACKING_SESSIONS_BY_SESSIONID_PHOTOS(sessionId!)}?count=2`, + const res = await api.get({ + path: ENDPOINTS.TRACKING_SESSIONS_BY_SESSIONID_PHOTOS(sessionId!), }); - return res.data ?? []; + return (res.data ?? []).map((p) => p.imageUrl); }, }); }