-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Invalid api call in getPathView
useEffect(() => {
var lat=37.8864916;
var lng=127.7364351;
navigator.geolocation.getCurrentPosition((pos) => {
lat = pos.coords.latitude;
lng = pos.coords.longitude;
});
let calcDistance = (p) => {
return Math.sqrt(Math.pow(p.latitude - lat, 2) + Math.pow(p.longitude - lng, 2));
}
// 군집 대표 좌표 리스트 서버에서 받아오기
axios.get('/api/report/location/union') // <------------------- 존재하지 않는 API를 호출함
.then(res => {
// 거리를 기준으로 정렬
res.sort((a, b) => calcDistance(a)-calcDistance(b));
setPath([
res[0],
res[1],
]);
}).catch(error => {console.log(error);})
}, [])수정 사항
- 존재하는 API 호출로 변경함
추가 컨텍스트
- 정상 작동 여부는 게시글 작성 페이지 #7 완료 후 통합하여 테스트 예정
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working