แก้ Fetchdata ข้อมูลหลัก
This commit is contained in:
parent
11e41bc974
commit
5276ba4db3
25 changed files with 178 additions and 108 deletions
|
|
@ -576,7 +576,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -595,7 +595,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -668,8 +668,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -713,6 +714,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -720,6 +722,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -727,7 +730,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -436,6 +436,7 @@ const fetchHistory = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -455,7 +456,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -474,7 +475,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -543,8 +544,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -574,6 +576,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -581,6 +584,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -588,7 +592,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -474,6 +474,7 @@ const fetchHistory = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -512,7 +513,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -582,8 +583,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -605,7 +607,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -620,6 +622,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -627,7 +630,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -516,7 +516,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -586,8 +586,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -609,7 +610,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -624,6 +625,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -631,7 +633,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -547,8 +547,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -578,6 +579,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -585,6 +587,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -592,7 +595,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -545,6 +545,7 @@ const save = async (publish: boolean) => {
|
|||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -574,6 +575,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -581,6 +583,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -588,7 +591,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue