Commit 0c874d39 by Nakarin Luankla

แก้ Service หน้า import-data

parent 050194e9
...@@ -236,7 +236,7 @@ export class ImportDataComponent { ...@@ -236,7 +236,7 @@ export class ImportDataComponent {
const formData = new FormData(); const formData = new FormData();
formData.append('file', this.selectedFile); formData.append('file', this.selectedFile);
this.loading = true this.loading = true
this.fileService.upload(formData, 'MJOBCODE_COMPETENCY').subscribe({ this.fileService.uploadExcel(formData, 'MJOBCODE_COMPETENCY').subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
...@@ -255,7 +255,7 @@ export class ImportDataComponent { ...@@ -255,7 +255,7 @@ export class ImportDataComponent {
downloadFile() { downloadFile() {
const fileName = 'IMPORT_MJOB.xlsx' const fileName = 'IMPORT_MJOB.xlsx'
this.fileService.download(fileName).subscribe({ this.fileService.downloadTemplate(fileName).subscribe({
next: response => { next: response => {
const url = window.URL.createObjectURL(response); const url = window.URL.createObjectURL(response);
const a = document.createElement("a"); const a = document.createElement("a");
......
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