แก้ fetchListBackup

This commit is contained in:
Net 2024-07-19 16:11:14 +07:00
parent 5891cbed86
commit 52921b8c1e

View file

@ -37,10 +37,14 @@ export const useDataStore = defineStore("systemStore", () => {
async function fetchListBackup() { async function fetchListBackup() {
showLoader(); showLoader();
await http
.get(config.API.backup) const res = await http.get(config.API.backup);
.then((res) => {
dataBackUp.value = res.data; hideLoader();
if (!res) return false;
if (res.status === 200) {
dataBackUp.value = await res.data;
dataBackUp.value = dataBackUp.value.map((item) => { dataBackUp.value = dataBackUp.value.map((item) => {
return { return {
@ -48,10 +52,9 @@ export const useDataStore = defineStore("systemStore", () => {
status: "สำเร็จ", status: "สำเร็จ",
}; };
}); });
})
.finally(() => { return res.status;
hideLoader(); }
});
} }
async function createBackUp() { async function createBackUp() {