fix: Issues #230 done.
This commit is contained in:
@@ -425,3 +425,32 @@ export async function deleteSuccess() {
|
||||
customClass: customClass
|
||||
})
|
||||
};
|
||||
/**
|
||||
* Really deleted information
|
||||
* @param {string} files 被刪除的檔案 html
|
||||
* @param {array} reallyDeldetData 被刪除的檔案 data,未取得 recordId 而傳入
|
||||
*/
|
||||
export async function reallyDeldetInformation(files, reallyDeldetData) {
|
||||
const filesStore = FilesStore();
|
||||
const deleteCustomClass = { ...customClass };
|
||||
const htmlText = `<div class="text-left mx-4 space-y-1"><p>The following file(s) have been deleted by other user(s):</p><ul class="list-disc ml-6">${files}</ul></div>`;
|
||||
let recordIdData = [];
|
||||
|
||||
deleteCustomClass.confirmButton = '!inline-block !rounded-full !text-sm !font-medium !text-center !align-middle !transition-colors !duration-300 !px-5 !py-2 !w-[100px] !h-[40px] !text-primary !bg-neutral-10 !border !border-primary';
|
||||
deleteCustomClass.cancelButton = null;
|
||||
await Swal.fire({
|
||||
title: 'FILE(S) DELETED BY OTHER USER(S)',
|
||||
html: htmlText,
|
||||
icon: 'info',
|
||||
iconColor: '#0099FF',
|
||||
customClass: deleteCustomClass,
|
||||
confirmButtonColor: '#ffffff',
|
||||
didOpen: () => {
|
||||
const confirmButton = Swal.getConfirmButton();
|
||||
|
||||
confirmButton.style.border = '1px solid #0099FF';
|
||||
}
|
||||
});
|
||||
recordIdData = await Promise.all(reallyDeldetData.map(file => filesStore.deletionRecord(file.id)));
|
||||
await filesStore.fetchAllFiles();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user