fix: Issues #231 done.

This commit is contained in:
chiayin
2024-03-01 16:53:30 +08:00
parent 20bfa0b2ef
commit 68cf73f4e5
2 changed files with 15 additions and 1 deletions

View File

@@ -352,3 +352,16 @@ export async function deleteFileModal(files, type, id, name) {
filesStore.deleteFile(type, id);
}
};
/**
* Delete Success
*/
export async function deleteSuccess() {
await Swal.fire({
title: 'File(S) COMPLETED',
timer: 3000, // 停留 3 秒後自動關閉
showConfirmButton: false,
icon: 'success',
iconColor: '#0099FF',
customClass: customClass
})
};

View File

@@ -3,7 +3,7 @@ import axios from "axios";
import moment from 'moment';
import apiError from '@/module/apiError.js';
import Swal from 'sweetalert2';
import { uploadFailedFirst, uploadFailedSecond, uploadloader, uploadSuccess } from '@/module/alertModal.js';
import { uploadFailedFirst, uploadFailedSecond, uploadloader, uploadSuccess, deleteSuccess } from '@/module/alertModal.js';
import pinia from '@/stores/main.js';
import loadingStore from '@/stores/loading.js';
@@ -280,6 +280,7 @@ export default defineStore('filesStore', {
try {
const response = await axios.delete(api);
await this.fetchAllFiles();
await deleteSuccess();
} catch(error) {
apiError(error, 'Failed to delete.');
} finally {