fix: Issues #230 done.

This commit is contained in:
chiayin
2024-03-22 15:42:20 +08:00
parent af2e9c75e3
commit dfc0d9a7a6
3 changed files with 90 additions and 3 deletions

View File

@@ -259,7 +259,6 @@ export default defineStore('filesStore', {
let api;
if(id == null || isNaN(id)) {
console.error('Delete File API:', id);
return $toast.default('Delete File API Error.', {position: 'bottom'});
};
loading.isLoading = true;
@@ -287,6 +286,22 @@ export default defineStore('filesStore', {
loading.isLoading = false;
}
},
/**
* Remove a Deletion Record真刪除被 Admin 或被其他帳號刪除的檔案
*/
async deletionRecord(id) {
let api = '';
loading.isLoading = true;
api = `/api/deletion/${id}`;
try {
const response = await axios.delete(api);
} catch(error) {
apiError(error, 'Failed to Remove a Deletion Record.')
} finally {
loading.isLoading = false;
}
},
/**
* Download file as CSV
* @param { string } type log | filter | log-check | filter-check