แก้ Fetchdata ข้อมูลหลัก
This commit is contained in:
parent
11e41bc974
commit
5276ba4db3
25 changed files with 178 additions and 108 deletions
|
|
@ -458,7 +458,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -477,7 +477,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -546,8 +546,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -569,7 +570,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -577,6 +578,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -584,6 +586,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -591,7 +594,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -546,8 +546,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -569,7 +570,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -591,7 +592,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -511,7 +511,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -581,8 +581,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -604,7 +605,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -612,6 +613,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -626,7 +628,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -589,7 +589,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -608,7 +608,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -683,8 +683,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -725,7 +726,7 @@ const checkDupDataName = (row: any) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -733,6 +734,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -740,6 +742,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -747,7 +750,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -477,7 +477,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -548,6 +548,7 @@ const save = async (publish: boolean) => {
|
|||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -569,7 +570,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -577,6 +578,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -584,6 +586,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -591,7 +594,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -477,7 +477,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -546,8 +546,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -569,7 +570,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -577,6 +578,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -584,6 +586,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -591,7 +594,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -477,7 +477,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -546,8 +546,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -569,7 +570,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -577,6 +578,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -584,6 +586,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -591,7 +594,7 @@ const clickDelete = async () => {
|
|||
*/
|
||||
const clickCancel = async () => {
|
||||
edit.value = false;
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ const clearPublishedData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -477,7 +477,7 @@ const publishedData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -546,8 +546,9 @@ const save = async (publish: boolean) => {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await fetchData(true);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -569,7 +570,7 @@ const checkDupDataName = (val: string) => {
|
|||
* ฟังก์ชันปุ่มแก้ไข ให้ get data มาใหม่
|
||||
*/
|
||||
const clickEdit = async () => {
|
||||
await fetchData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -577,6 +578,7 @@ const clickEdit = async () => {
|
|||
*/
|
||||
const clickSave = async () => {
|
||||
await save(false);
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -584,6 +586,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const clickDelete = async () => {
|
||||
await clearPublishedData();
|
||||
await fetchData(true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -591,7 +594,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