Files: Filter files can enter Discover.

This commit is contained in:
chiayin
2023-04-28 11:29:21 +08:00
parent e142787832
commit bf63d0aca4
3 changed files with 22 additions and 9 deletions

View File

@@ -83,7 +83,13 @@ export default defineStore('allMapDataStore', {
async getAllMapData() {
let logId = this.logId;
let tempFilterId = this.tempFilterId;
let api = tempFilterId != null ? `/api/temp-filters/${tempFilterId}/discover` : `/api/logs/${logId}/discover`;
let filterId = this.createFilterId
let api = '';
// 先判斷暫存 再判斷 filter 最後 log
if(tempFilterId != null) api = `/api/temp-filters/${tempFilterId}/discover`;
else if(filterId!= null) api = `/api/filters/${filterId}/discover`;
else api = `/api/logs/${logId}/discover`;
try {
const response = await this.$axios.get(api);
@@ -230,6 +236,7 @@ export default defineStore('allMapDataStore', {
const response = await this.$axios.post(api, createFilterObj)
this.createFilterId = response.data.id;
this.tempFilterId = null;
console.log('this.createFilterId', this.createFilterId);
}catch(error) {
this.httpStatus = error.request.status;
await delay();