Fix module-level store init in files.js, apiError.js, cytoscapeMap.js and add files store tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,11 +4,8 @@ import moment from 'moment';
|
||||
import apiError from '@/module/apiError.js';
|
||||
import Swal from 'sweetalert2';
|
||||
import { uploadFailedFirst, uploadFailedSecond, uploadloader, uploadSuccess, deleteSuccess } from '@/module/alertModal.js';
|
||||
import pinia from '@/stores/main.ts';
|
||||
import loadingStore from '@/stores/loading.js';
|
||||
|
||||
const loading = loadingStore(pinia);
|
||||
|
||||
export default defineStore('filesStore', {
|
||||
state: () => ({
|
||||
allEventFiles: [
|
||||
@@ -261,6 +258,7 @@ export default defineStore('filesStore', {
|
||||
if(id == null || isNaN(id)) {
|
||||
return $toast.default('Delete File API Error.', {position: 'bottom'});
|
||||
};
|
||||
const loading = loadingStore();
|
||||
loading.isLoading = true;
|
||||
switch (type) {
|
||||
case 'log':
|
||||
@@ -294,6 +292,7 @@ export default defineStore('filesStore', {
|
||||
async deletionRecord(id) {
|
||||
let api = '';
|
||||
|
||||
const loading = loadingStore();
|
||||
loading.isLoading = true;
|
||||
api = `/api/deletion/${id}`;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user