diff --git a/src/components/Discover/Map/Filter/Funnel.vue b/src/components/Discover/Map/Filter/Funnel.vue index d7909c9..6f226d7 100644 --- a/src/components/Discover/Map/Filter/Funnel.vue +++ b/src/components/Discover/Map/Filter/Funnel.vue @@ -93,6 +93,7 @@ export default { this.isLoading = true; await this.allMapDataStore.addTempFilterId(); await this.allMapDataStore.getAllMapData(); + await this.allMapDataStore.getAllTrace(); // SidebarTrace 要連動 await this.$emit('submit-all'); this.isLoading = false; this.$toast.success('Filter Success. View the Map.'); diff --git a/src/stores/allMapData.js b/src/stores/allMapData.js index f731951..5163ecd 100644 --- a/src/stores/allMapData.js +++ b/src/stores/allMapData.js @@ -121,7 +121,14 @@ export default defineStore('allMapDataStore', { */ async getAllTrace() { let logId = this.logId; - const api = `/api/logs/${logId}/traces`; + let tempFilterId = this.tempFilterId; + let createfilterId = this.createFilterId + let api = ''; + + // 先判斷暫存 再判斷 filter 最後 log + if(tempFilterId != null) api = `/api/temp-filters/${tempFilterId}/traces`; + else if(createfilterId!= null) api = `/api/filters/${createfilterId}/traces`; + else api = `/api/logs/${logId}/traces`; try { const response = await this.$axios.get(api);