Apply repository-wide ESLint auto-fix formatting pass
Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
@@ -11,15 +11,15 @@
|
||||
|
||||
import { defineStore } from "pinia";
|
||||
import apiClient from "@/api/client.js";
|
||||
import apiError from '@/module/apiError.js';
|
||||
import apiError from "@/module/apiError.js";
|
||||
|
||||
/** Pinia store for the Compare Dashboard page data. */
|
||||
export const useCompareStore = defineStore('compareStore', {
|
||||
export const useCompareStore = defineStore("compareStore", {
|
||||
state: () => ({
|
||||
allCompareDashboardData: null,
|
||||
}),
|
||||
getters: {
|
||||
compareDashboardData: state => {
|
||||
compareDashboardData: (state) => {
|
||||
return state.allCompareDashboardData;
|
||||
},
|
||||
},
|
||||
@@ -36,8 +36,8 @@ export const useCompareStore = defineStore('compareStore', {
|
||||
try {
|
||||
const response = await apiClient.get(api);
|
||||
this.allCompareDashboardData = response.data;
|
||||
} catch(error) {
|
||||
apiError(error, 'Failed to load the Compare.');
|
||||
} catch (error) {
|
||||
apiError(error, "Failed to load the Compare.");
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -46,38 +46,38 @@ export const useCompareStore = defineStore('compareStore', {
|
||||
* @param {number} id log or filter ID
|
||||
*/
|
||||
async getStateData(type, id) {
|
||||
let api = '';
|
||||
let api = "";
|
||||
|
||||
switch (type) {
|
||||
case 'log':
|
||||
case "log":
|
||||
api = `/api/logs/${id}/discover`;
|
||||
break;
|
||||
case 'filter':
|
||||
api = `/api/filters/${id}/discover`
|
||||
case "filter":
|
||||
api = `/api/filters/${id}/discover`;
|
||||
break;
|
||||
}
|
||||
try {
|
||||
const response = await apiClient.get(api);
|
||||
|
||||
return response.data.stats;
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
apiError(error, "Failed to load the Compare's States.");
|
||||
};
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get file's name
|
||||
* @param {number} id log or filter ID
|
||||
*/
|
||||
async getFileName(id) {
|
||||
id = Number(id)
|
||||
id = Number(id);
|
||||
try {
|
||||
const response = await apiClient.get('/api/files');
|
||||
const file = response.data.find(i => i.id === id);
|
||||
const response = await apiClient.get("/api/files");
|
||||
const file = response.data.find((i) => i.id === id);
|
||||
|
||||
if(file) return file.name;
|
||||
} catch(error) {
|
||||
if (file) return file.name;
|
||||
} catch (error) {
|
||||
apiError(error, "Failed to load the Compare's file name.");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user