오수빈

ignore default

...@@ -14,13 +14,15 @@ let user_longitude; ...@@ -14,13 +14,15 @@ let user_longitude;
14 let hospital_list = []; 14 let hospital_list = [];
15 15
16 router.post('/hospital', function(req, res){ 16 router.post('/hospital', function(req, res){
17 + //gu 받아오기
17 var body = req.body; 18 var body = req.body;
18 var gu_select = body.user_gu; 19 var gu_select = body.user_gu;
19 - console.log(gu_select); 20 + //console.log(gu_select);
20 21
22 + // encoding for url
21 var menu = urlencode('동물병원'); 23 var menu = urlencode('동물병원');
22 var gu_select_encode = urlencode(gu_select); 24 var gu_select_encode = urlencode(gu_select);
23 - console.log(gu_select_encode); 25 + //console.log(gu_select_encode);
24 26
25 //api 27 //api
26 let pet_url = `http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=100&pageNo=1&keyword=${menu}&where=${gu_select_encode}`; 28 let pet_url = `http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=100&pageNo=1&keyword=${menu}&where=${gu_select_encode}`;
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
69 <script> 69 <script>
70 function sm() { 70 function sm() {
71 document.getElementById("location").submit(); 71 document.getElementById("location").submit();
72 - //document.location.href="/category/hospital";
73 } 72 }
74 </script> 73 </script>
75 74
...@@ -94,7 +93,7 @@ ...@@ -94,7 +93,7 @@
94 </p> 93 </p>
95 <form action="/category/hospital" method="post" name="location" id="location"> 94 <form action="/category/hospital" method="post" name="location" id="location">
96 <select onchange="sm()" name="user_gu" id="user_gu_select"> 95 <select onchange="sm()" name="user_gu" id="user_gu_select">
97 - <option value="">--Please choose an option--</option> 96 + <option value='' selected="true" disabled="true">--Please choose an option--</option>
98 <option value='금천구'>금천구</option> 97 <option value='금천구'>금천구</option>
99 <option value='강남구'>강남구</option> 98 <option value='강남구'>강남구</option>
100 </select> 99 </select>
......