diff --git a/src/api/attraction.js b/src/api/attraction.js index 765ed47..bdd5799 100644 --- a/src/api/attraction.js +++ b/src/api/attraction.js @@ -4,7 +4,7 @@ const local = localAxios; function searchAttarctions(queryString, success, fail) { //list - local.get(`/attraction/search?contentTypeId=12&${queryString}`).then(success).catch(fail); + local.get(`/attraction/search?${queryString}`).then(success).catch(fail); } export { searchAttarctions }; diff --git a/src/components/search/SearchBar.vue b/src/components/search/SearchBar.vue index 983d68b..2f483e8 100644 --- a/src/components/search/SearchBar.vue +++ b/src/components/search/SearchBar.vue @@ -20,7 +20,7 @@ const sidoList = ref([]); const gugunList = ref([]); const sido = ref({ sidoCode: 0 }); const gugun = ref({ gugunCode: 0 }); -const contentType = ref(contentTypeList[0]); +const contentType = ref(0); const keyword = ref(''); watch(sido, ({ sidoCode }) => { @@ -38,7 +38,8 @@ function handleSubmit() { const { gugunCode } = gugun.value; const areaQuery = `sidoCode=${sidoCode}` + (sidoCode ? `&gugunCode=${gugunCode}` : ''); const keywordQuery = `title=${keyword.value}`; - const queryString = [areaQuery, keywordQuery].join('&'); + const contentTypeQuery = `contentTypeId=${contentType.value.value}`; + const queryString = [areaQuery, keywordQuery, contentTypeQuery].join('&'); setQueryString(queryString); search();