แก้ไข prefix
This commit is contained in:
parent
a5564cf99a
commit
3c76b56d21
1 changed files with 8 additions and 8 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue