แก้ fetchListBackup
This commit is contained in:
parent
5891cbed86
commit
52921b8c1e
1 changed files with 16 additions and 13 deletions
|
|
@ -37,21 +37,24 @@ export const useDataStore = defineStore("systemStore", () => {
|
|||
|
||||
async function fetchListBackup() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.backup)
|
||||
.then((res) => {
|
||||
dataBackUp.value = res.data;
|
||||
|
||||
dataBackUp.value = dataBackUp.value.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
status: "สำเร็จ",
|
||||
};
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
const res = await http.get(config.API.backup);
|
||||
|
||||
hideLoader();
|
||||
if (!res) return false;
|
||||
|
||||
if (res.status === 200) {
|
||||
dataBackUp.value = await res.data;
|
||||
|
||||
dataBackUp.value = dataBackUp.value.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
status: "สำเร็จ",
|
||||
};
|
||||
});
|
||||
|
||||
return res.status;
|
||||
}
|
||||
}
|
||||
|
||||
async function createBackUp() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue