ทะเบียนประวัติ => เอกสารหลักฐานและอื่นๆ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-16 17:58:33 +07:00
parent 4c534ebd94
commit ad53e6bd54
2 changed files with 26 additions and 57 deletions

View file

@ -57,9 +57,9 @@ async function uploadFileDoc(uploadUrl: string, file: any) {
"Content-Type": file.type,
},
})
.then((res) => {
.then(async () => {
await getData();
success($q, "อัปโหลดไฟล์สำเร็จ");
getData();
})
.catch((e) => {
messageError($q, e);
@ -70,12 +70,12 @@ async function uploadFileDoc(uploadUrl: string, file: any) {
});
}
async function clickUpload(file: any) {
function clickUpload(file: any) {
const fileName = { fileName: file.name };
dialogConfirm(
$q,
async () => {
showLoader();
const selectedFile = file;
const formdata = new FormData();
formdata.append("file", selectedFile);
@ -152,17 +152,14 @@ function deleteFile(fileName: string) {
fileName
)
)
.then((res) => {
success($q, `ลบไฟล์สำเร็จ`);
setTimeout(() => {
getData();
hideLoader();
}, 1000);
.then(async () => {
await setTimeout(async () => {
await getData();
await success($q, `ลบไฟล์สำเร็จ`);
}, 1500);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});