validatedCity, mask for input, confirmatonService, Version Info,
This commit is contained in:
@@ -48,23 +48,15 @@ export class ImageCropAndUploadComponent {
|
||||
this.imageChangedEvent = null;
|
||||
this.croppedImage = null;
|
||||
this.showModal = false;
|
||||
this.fileInput.nativeElement.value = '';
|
||||
this.uploadFinished.emit({ success: false, type: this.uploadParams.type });
|
||||
}
|
||||
|
||||
uploadImage() {
|
||||
async uploadImage() {
|
||||
if (this.croppedImage) {
|
||||
this.imageService.uploadImage(this.croppedImage, this.uploadParams.type, this.uploadParams.imagePath, this.uploadParams.serialId).subscribe(
|
||||
response => {
|
||||
console.log('Upload successful', response);
|
||||
this.closeModal();
|
||||
this.uploadFinished.emit({ success: true, type: this.uploadParams.type });
|
||||
},
|
||||
error => {
|
||||
console.error('Upload failed', error);
|
||||
this.closeModal();
|
||||
this.uploadFinished.emit({ success: false, type: this.uploadParams.type });
|
||||
},
|
||||
);
|
||||
await this.imageService.uploadImage(this.croppedImage, this.uploadParams.type, this.uploadParams.imagePath, this.uploadParams.serialId);
|
||||
this.closeModal();
|
||||
this.uploadFinished.emit({ success: true, type: this.uploadParams.type });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user