เพิ่ม ลบ backUp
This commit is contained in:
parent
662d8fa7b3
commit
c417262c6a
2 changed files with 23 additions and 7 deletions
|
|
@ -41,7 +41,20 @@ export const useDataStore = defineStore("storeData", () => {
|
|||
fetchListBackup();
|
||||
})
|
||||
.finally(() => {
|
||||
console.log("aye");
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteBackUp(filename: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.backup + "/delete", {
|
||||
data: { filename: filename },
|
||||
})
|
||||
.then(async (res) => {
|
||||
fetchListBackup();
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
|
@ -49,7 +62,9 @@ export const useDataStore = defineStore("storeData", () => {
|
|||
async function restore(filename: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.restore + "?filename=" + filename + "")
|
||||
.post(config.API.restore, {
|
||||
filename: filename,
|
||||
})
|
||||
.then((res) => {
|
||||
fetchListBackup();
|
||||
})
|
||||
|
|
@ -64,5 +79,6 @@ export const useDataStore = defineStore("storeData", () => {
|
|||
fetchListBackup,
|
||||
createBackUp,
|
||||
restore,
|
||||
deleteBackUp,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue