refactor (slight, although many files)
This commit is contained in:
@@ -193,9 +193,12 @@ export default defineStore('conformanceStore', {
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterId !== null) api = `/api/filter-checks/params?filter_id=${filterId}`;
|
||||
else api = `/api/log-checks/params?log_id=${logId}`;
|
||||
|
||||
if(filterId !== null) {
|
||||
api = `/api/filter-checks/params?filter_id=${filterId}`;
|
||||
}
|
||||
else {
|
||||
api = `/api/log-checks/params?log_id=${logId}`;
|
||||
}
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
this.allConformanceTask = response.data.tasks;
|
||||
@@ -218,13 +221,22 @@ export default defineStore('conformanceStore', {
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterId !== null) api = `/api/temp-filter-checks?filter_id=${filterId}`;
|
||||
else api = `/api/temp-log-checks?log_id=${logId}`;
|
||||
if(filterId !== null) {
|
||||
api = `/api/temp-filter-checks?filter_id=${filterId}`;
|
||||
}
|
||||
else {
|
||||
api = `/api/temp-log-checks?log_id=${logId}`;
|
||||
}
|
||||
|
||||
try {
|
||||
console.log("addConformanceCheckId() axios data", data)
|
||||
const response = await this.$axios.post(api, data);
|
||||
if(filterId !== null) this.conformanceFilterTempCheckId = response.data.id;
|
||||
else this.conformanceLogTempCheckId = response.data.id;
|
||||
if(filterId !== null) {
|
||||
this.conformanceFilterTempCheckId = response.data.id;
|
||||
}
|
||||
else {
|
||||
this.conformanceLogTempCheckId = response.data.id;
|
||||
}
|
||||
} catch(error) {
|
||||
apiError(error, 'Failed to add the Temporary Check for a file.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user