Skip to content

Commit

Permalink
Merge pull request #76 from Sohith-code/bulk-upload-designations
Browse files Browse the repository at this point in the history
Bulk upload designations file validation change
  • Loading branch information
vishnubansaltarento authored Oct 30, 2024
2 parents 354fda6 + ef76562 commit 765b263
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class BulkUploadComponent implements OnInit, OnDestroy, AfterViewInit {

showFileError = false
public fileName: any
public fileType: any
fileSelected!: any
userProfile: any
fileUploadDialogInstance: any
Expand Down Expand Up @@ -140,9 +141,9 @@ export class BulkUploadComponent implements OnInit, OnDestroy, AfterViewInit {
const file: File = fileList[0]
if (file) {
this.fileName = file.name
const fileType = file.type
this.fileType = file.type
this.fileSelected = file
if (this.fileService.validateExcelFile(fileType)) {
if (this.fileService.validateExcelFile(this.fileType)) {
this.verifyOTP(this.userProfile.email ? 'email' : 'phone')
// this.showFileUploadProgress()
// this.uploadCSVFile()
Expand Down Expand Up @@ -170,7 +171,7 @@ export class BulkUploadComponent implements OnInit, OnDestroy, AfterViewInit {
}

uploadCSVFile(): void {
if (this.fileService.validateFile(this.fileName)) {
if (this.fileService.validateExcelFile(this.fileType)) {
if (this.fileSelected) {
const formData: FormData = new FormData()
formData.append('file', this.fileSelected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class BulkUploadOdcsComponent implements OnInit, OnDestroy, AfterViewInit

showFileError = false
public fileName: any
public fileType: any
fileSelected!: any
userProfile: any
fileUploadDialogInstance: any
Expand Down Expand Up @@ -138,9 +139,9 @@ export class BulkUploadOdcsComponent implements OnInit, OnDestroy, AfterViewInit
const file: File = fileList[0]
if (file) {
this.fileName = file.name
const fileType = file.type
this.fileType = file.type
this.fileSelected = file
if (this.fileService.validateExcelFile(fileType)) {
if (this.fileService.validateExcelFile(this.fileType)) {
this.verifyOTP(this.userProfile.email ? 'email' : 'phone')
} else {
this.showFileError = true
Expand All @@ -166,7 +167,7 @@ export class BulkUploadOdcsComponent implements OnInit, OnDestroy, AfterViewInit
}

uploadCSVFile(): void {
if (this.fileService.validateFile(this.fileName)) {
if (this.fileService.validateExcelFile(this.fileType)) {
if (this.fileSelected) {
const formData: FormData = new FormData()
formData.append('file', this.fileSelected)
Expand Down

0 comments on commit 765b263

Please sign in to comment.