Merge branch 'search'

This commit is contained in:
jhynsoo 2024-05-21 15:57:30 +09:00
commit 09344000b6
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,7 @@ const local = localAxios;
function searchAttarctions(queryString, success, fail) { function searchAttarctions(queryString, success, fail) {
//list //list
local.get(`/attraction/search?contentTypeId=12&${queryString}`).then(success).catch(fail); local.get(`/attraction/search?${queryString}`).then(success).catch(fail);
} }
export { searchAttarctions }; export { searchAttarctions };

View File

@ -20,7 +20,7 @@ const sidoList = ref([]);
const gugunList = ref([]); const gugunList = ref([]);
const sido = ref({ sidoCode: 0 }); const sido = ref({ sidoCode: 0 });
const gugun = ref({ gugunCode: 0 }); const gugun = ref({ gugunCode: 0 });
const contentType = ref(contentTypeList[0]); const contentType = ref(0);
const keyword = ref(''); const keyword = ref('');
watch(sido, ({ sidoCode }) => { watch(sido, ({ sidoCode }) => {
@ -38,7 +38,8 @@ function handleSubmit() {
const { gugunCode } = gugun.value; const { gugunCode } = gugun.value;
const areaQuery = `sidoCode=${sidoCode}` + (sidoCode ? `&gugunCode=${gugunCode}` : ''); const areaQuery = `sidoCode=${sidoCode}` + (sidoCode ? `&gugunCode=${gugunCode}` : '');
const keywordQuery = `title=${keyword.value}`; const keywordQuery = `title=${keyword.value}`;
const queryString = [areaQuery, keywordQuery].join('&'); const contentTypeQuery = `contentTypeId=${contentType.value.value}`;
const queryString = [areaQuery, keywordQuery, contentTypeQuery].join('&');
setQueryString(queryString); setQueryString(queryString);
search(); search();