fix: Issues #231 done.
This commit is contained in:
@@ -352,3 +352,16 @@ export async function deleteFileModal(files, type, id, name) {
|
|||||||
filesStore.deleteFile(type, id);
|
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
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import axios from "axios";
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import apiError from '@/module/apiError.js';
|
import apiError from '@/module/apiError.js';
|
||||||
import Swal from 'sweetalert2';
|
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 pinia from '@/stores/main.js';
|
||||||
import loadingStore from '@/stores/loading.js';
|
import loadingStore from '@/stores/loading.js';
|
||||||
|
|
||||||
@@ -280,6 +280,7 @@ export default defineStore('filesStore', {
|
|||||||
try {
|
try {
|
||||||
const response = await axios.delete(api);
|
const response = await axios.delete(api);
|
||||||
await this.fetchAllFiles();
|
await this.fetchAllFiles();
|
||||||
|
await deleteSuccess();
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
apiError(error, 'Failed to delete.');
|
apiError(error, 'Failed to delete.');
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user