Fix: fix api url

This commit is contained in:
jhynsoo 2024-05-23 09:51:57 +09:00
parent d3865adcde
commit 74c3c5d7ba

View File

@ -1,9 +1,9 @@
<script setup> <script setup>
import { reactive, ref, watch } from 'vue'; import { reactive, ref, watch } from 'vue';
import axios from 'axios';
import Select from '../common/Select.vue'; import Select from '../common/Select.vue';
import { useAttractionStore } from '@/stores/attractionStore'; import { useAttractionStore } from '@/stores/attractionStore';
import SearchBox from '../common/SearchBox.vue'; import SearchBox from '../common/SearchBox.vue';
import { getGugun, getSido } from '@/api/area';
const contentTypeList = reactive([ const contentTypeList = reactive([
{ value: 0, name: '전체' }, { value: 0, name: '전체' },
@ -29,16 +29,14 @@ watch(sido, ({ sidoCode }) => {
if (sidoCode === 0) { if (sidoCode === 0) {
return; return;
} }
axios.get(`//localhost:8000/area/gugun?sidoCode=${sidoCode}`).then(({ data }) => { getGugun(sidoCode).then(({ data }) => {
gugunList.value = [{ gugunCode: 0, gugunName: '전체' }, ...data]; gugunList.value = [{ gugunCode: 0, gugunName: '전체' }, ...data];
}); });
console.log(keyword.value); console.log(keyword.value);
}); });
if (sidoList.value.length === 0) { if (sidoList.value.length === 0) {
axios getSido().then(({ data }) => (sidoList.value = [{ sidoCode: 0, sidoName: '전체' }, ...data]));
.get('//localhost:8000/area/sido')
.then(({ data }) => (sidoList.value = [{ sidoCode: 0, sidoName: '전체' }, ...data]));
} }
function handleSubmit() { function handleSubmit() {