refactor code (ยังไม่หมด)
This commit is contained in:
parent
ab4189e6ed
commit
32d4de7075
21 changed files with 309 additions and 109 deletions
|
|
@ -12,7 +12,10 @@ const { showLoader, messageError, hideLoader, dialogConfirm, success } = mixin;
|
|||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
|
||||
/** บันทึกข้อมูลเเละ route กลับหน้าหลัก */
|
||||
/**
|
||||
* บันทึกข้อมูล อุทธรณ์/ร้องทุกข์
|
||||
* @param data ชุดข้อมูล
|
||||
*/
|
||||
async function onSubmit(data: any) {
|
||||
console.log("add", data);
|
||||
const formData = new FormData();
|
||||
|
|
@ -33,6 +36,7 @@ async function onSubmit(data: any) {
|
|||
.post(config.API.appealAdd() + "/admin", formData)
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
//เปลี่ยนหน้าไปหน้ารายละเอียด
|
||||
router.push(`/discipline-appealcomplain/${res.data.result}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -41,7 +45,6 @@ async function onSubmit(data: any) {
|
|||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
// router.push(`/discipline-appealcomplain`);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue