Commit 041bbcaf by Natthaphat

แจ้งเตือน swal อัปไฟล์อื่นผิด

parent 956b2d7e
......@@ -316,7 +316,7 @@ export class ExcelListComponent implements OnInit {
}
});
}
showAlert(text: string, type: 'success' | 'error') {
showAlert(text: string, type: 'success' | 'error' | 'warning') {
swal("แจ้งเตือน", text, type);
}
......@@ -477,7 +477,7 @@ export class ExcelListComponent implements OnInit {
const file: File = event.target.files[0];
if (!file) {
alert('กรุณาเลือกไฟล์');
this.showAlert('กรุณาเลือกไฟล์','warning');
return;
}
......@@ -485,7 +485,7 @@ export class ExcelListComponent implements OnInit {
const fileExtension = file.name.split('.').pop()?.toLowerCase();
if (!this.allowedExtensions.includes(fileExtension || '')) {
alert('รองรับเฉพาะไฟล์ Excel (.xls, .xlsx, .xlsm) เท่านั้น');
this.showAlert('รองรับเฉพาะไฟล์ Excel (.xls, .xlsx, .xlsm) เท่านั้น','error');
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment