-
Notifications
You must be signed in to change notification settings - Fork 1
fix : demo API 제거 및 기록 화면 통계 API 연동 복원 #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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<string[]>({ | ||
| path: `${ENDPOINTS.DEMO_TRACKING_SESSIONS_BY_SESSIONID_PHOTOS(sessionId!)}?count=2`, | ||
| const res = await api.get<ClivePhoto[]>({ | ||
| path: ENDPOINTS.TRACKING_SESSIONS_BY_SESSIONID_PHOTOS(sessionId!), | ||
| }); | ||
| return res.data ?? []; | ||
| return (res.data ?? []).map((p) => p.imageUrl); | ||
| }, | ||
|
Comment on lines
3
to
26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
또한, import { ENDPOINTS, TrackingPhotoResponse } from "@/types/api.generated";
export function useClivePhotos(sessionId: number | null) {
return useQuery({
queryKey: ["clivePhotos", sessionId],
enabled: sessionId != null,
queryFn: async () => {
const res = await api.get<TrackingPhotoResponse[]>({
path: ENDPOINTS.TRACKING_SESSIONS_BY_SESSIONID_PHOTOS(sessionId!),
});
return (res.data ?? [])
.map((p) => p.imageUrl)
.filter((url): url is string => !!url);
},
});
} |
||
| }); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고도 단위가
Nm으로 표시되고 있습니다. 원래 하드코딩된 값은642m이었으며, 고도(ascentMeters)의 표준 단위는 미터(m)입니다.Nm은 뉴턴 미터(Newton-meter) 또는 해리(Nautical Mile)를 의미하므로 오타일 가능성이 높습니다. 사용자에게 올바른 단위를 보여주기 위해m으로 수정하는 것을 권장합니다.