From e5a2af6a7ddbf3cc8d129c46dcefafd8ee5a6224 Mon Sep 17 00:00:00 2001 From: jhynsoo Date: Tue, 21 May 2024 15:57:19 +0900 Subject: [PATCH] Fix: fix search --- src/api/attraction.js | 2 +- src/components/search/SearchBar.vue | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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();