แก้ไข prefix

This commit is contained in:
Thanit Konmek 2023-06-09 17:16:57 +07:00
parent a5564cf99a
commit 3c76b56d21

View file

@ -371,15 +371,15 @@ const $q = useQuasar();
/**
* งก get data าส
*/
const fetchData = async () => {
const fetchData = async (load: boolean = false) => {
await props.fetchDataComponent();
// rows.value = [];
const result = await getPrefix(false, true);
const result = await getPrefix(false, load);
version.value = result.version; // published= draft=
idVersion.value = result.idversion; // id mongodb
rows.value = result.data;
updateData.value = false;
console.log(result);
// rows.value.splice(0);
// showLoader();
// await http
@ -459,7 +459,7 @@ const clearPublishedData = async () => {
})
.finally(async () => {
await fetchHistory();
await fetchData();
await fetchData(true);
});
};
@ -478,7 +478,7 @@ const publishedData = async () => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
await fetchData(true);
});
};
@ -538,7 +538,7 @@ const save = async (publish: boolean) => {
.then(async (res) => {
if (publish === false) {
success($q, "บันทึกข้อมูลร่างสำเร็จ");
await fetchData(); // get data
await fetchData(true); // get data
} else {
await publishedData(); //
}
@ -570,7 +570,7 @@ const checkDupDataName = (val: string) => {
* งกนปมแกไข ให get data มาใหม
*/
const clickEdit = async () => {
await fetchData();
await fetchData(true);
};
/**
@ -592,7 +592,7 @@ const clickDelete = async () => {
*/
const clickCancel = async () => {
edit.value = false;
await fetchData();
await fetchData(true);
};
/**