Commit f00f0e06 by Nattana Chaiyamat

import upload

parent 0da98657
...@@ -54,7 +54,7 @@ export class GroupCompetenciesComponent { ...@@ -54,7 +54,7 @@ export class GroupCompetenciesComponent {
const formData = new FormData(); const formData = new FormData();
formData.append('file', this.selectedFile); formData.append('file', this.selectedFile);
this.dataLoading = true this.dataLoading = true
this.fileService.uploadExcel(formData, '').subscribe({ this.fileService.uploadExcel(formData, 'COMPETENCY_GROUP_ASSESSMENT').subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
...@@ -73,7 +73,7 @@ export class GroupCompetenciesComponent { ...@@ -73,7 +73,7 @@ export class GroupCompetenciesComponent {
} }
downloadFile() { downloadFile() {
const fileName = '.xlsx' const fileName = 'IMPORT_COMPETENCY_GROUP_ASSESSMENT.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({ this.fileService.downloadTemplate(fileName).subscribe({
next: response => { next: response => {
const url = window.URL.createObjectURL(response); const url = window.URL.createObjectURL(response);
......
...@@ -89,7 +89,7 @@ export class EditGroupIndicators implements OnInit { ...@@ -89,7 +89,7 @@ export class EditGroupIndicators implements OnInit {
const formData = new FormData(); const formData = new FormData();
formData.append('file', this.selectedFile); formData.append('file', this.selectedFile);
this.dataLoading = true this.dataLoading = true
this.fileService.uploadExcel(formData, '').subscribe({ this.fileService.uploadExcel(formData, 'COMPETENCY_INDICATORS_COURSES').subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
...@@ -108,7 +108,7 @@ export class EditGroupIndicators implements OnInit { ...@@ -108,7 +108,7 @@ export class EditGroupIndicators implements OnInit {
} }
downloadFile() { downloadFile() {
const fileName = '.xlsx' const fileName = 'IMPORT_COMPETENCY_INDICATORS.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({ this.fileService.downloadTemplate(fileName).subscribe({
next: response => { next: response => {
const url = window.URL.createObjectURL(response); const url = window.URL.createObjectURL(response);
......
...@@ -62,7 +62,7 @@ export class SetApproversComponent { ...@@ -62,7 +62,7 @@ export class SetApproversComponent {
const formData = new FormData(); const formData = new FormData();
formData.append('file', this.selectedFile); formData.append('file', this.selectedFile);
this.groupapprove_listLoading = true this.groupapprove_listLoading = true
this.fileService.uploadExcel(formData, '').subscribe({ this.fileService.uploadExcel(formData, 'COMPETENCY_GROUP_APPROVE').subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
...@@ -80,7 +80,7 @@ export class SetApproversComponent { ...@@ -80,7 +80,7 @@ export class SetApproversComponent {
}) })
} }
downloadFile() { downloadFile() {
const fileName = '.xlsx' const fileName = 'IMPORT_COMPETENCY_GROUP_APPROVE.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({ this.fileService.downloadTemplate(fileName).subscribe({
next: response => { next: response => {
const url = window.URL.createObjectURL(response); const url = window.URL.createObjectURL(response);
......
...@@ -42,7 +42,7 @@ export class DevelopmentCourseComponent { ...@@ -42,7 +42,7 @@ export class DevelopmentCourseComponent {
const formData = new FormData(); const formData = new FormData();
formData.append('file', this.selectedFile); formData.append('file', this.selectedFile);
this.competencyCourse.loading = true this.competencyCourse.loading = true
this.fileService.uploadExcel(formData, '').subscribe({ this.fileService.uploadExcel(formData, 'COMPETENCY_COURSE').subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
...@@ -60,7 +60,7 @@ export class DevelopmentCourseComponent { ...@@ -60,7 +60,7 @@ export class DevelopmentCourseComponent {
}) })
} }
downloadFile() { downloadFile() {
const fileName = '.xlsx' const fileName = 'IMPORT_COMPETENCY_COURSE.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({ this.fileService.downloadTemplate(fileName).subscribe({
next: response => { next: response => {
const url = window.URL.createObjectURL(response); const url = window.URL.createObjectURL(response);
......
...@@ -48,7 +48,7 @@ export class AssessmentToolComponent { ...@@ -48,7 +48,7 @@ export class AssessmentToolComponent {
const formData = new FormData(); const formData = new FormData();
formData.append('file', this.selectedFile); formData.append('file', this.selectedFile);
this.assessment.loading = true this.assessment.loading = true
this.fileService.uploadExcel(formData, '').subscribe({ this.fileService.uploadExcel(formData, 'COMPETENCY_ASSESSMENT').subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
...@@ -66,7 +66,7 @@ export class AssessmentToolComponent { ...@@ -66,7 +66,7 @@ export class AssessmentToolComponent {
}) })
} }
downloadFile() { downloadFile() {
const fileName = '.xlsx' const fileName = 'IMPORT_COMPETENCY_ASSESSMENT.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({ this.fileService.downloadTemplate(fileName).subscribe({
next: response => { next: response => {
const url = window.URL.createObjectURL(response); const url = window.URL.createObjectURL(response);
......
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