Skip to content
Snippets Groups Projects
Verified Commit b3df5113 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #9107 add handle error maileva front

parent c5d9d582
No related branches found
No related tags found
No related merge requests found
...@@ -31,19 +31,19 @@ export class SendShippingActionComponent implements OnInit { ...@@ -31,19 +31,19 @@ export class SendShippingActionComponent implements OnInit {
currentShipping: any = null; currentShipping: any = null;
entitiesList: string [] = []; entitiesList: string[] = [];
attachList: any [] = []; attachList: any[] = [];
mailsNotSend: any[] = [] mailsNotSend: any[] = []
@ViewChild('noteEditor') noteEditor: NoteEditorComponent; @ViewChild('noteEditor') noteEditor: NoteEditorComponent;
constructor(public http: HttpClient, private notify: NotificationService, public dialogRef: MatDialogRef<SendShippingActionComponent>, @Inject(MAT_DIALOG_DATA) public data: any) { } constructor(public http: HttpClient, private notify: NotificationService, public dialogRef: MatDialogRef<SendShippingActionComponent>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void { ngOnInit(): void {
this.loading = true; this.loading = true;
this.http.post('../../rest/resourcesList/users/' + this.data.currentBasketInfo.ownerId + '/groups/' + this.data.currentBasketInfo.groupId + '/baskets/' + this.data.currentBasketInfo.basketId + '/actions/' + this.data.action.id + '/checkShippings', {resources : this.data.selectedRes}) this.http.post('../../rest/resourcesList/users/' + this.data.currentBasketInfo.ownerId + '/groups/' + this.data.currentBasketInfo.groupId + '/baskets/' + this.data.currentBasketInfo.basketId + '/actions/' + this.data.action.id + '/checkShippings', { resources: this.data.selectedRes })
.subscribe((data: any) => { .subscribe((data: any) => {
this.shippings = data.shippingTemplates; this.shippings = data.shippingTemplates;
this.mailsNotSend = data.canNotSend; this.mailsNotSend = data.canNotSend;
...@@ -61,14 +61,19 @@ export class SendShippingActionComponent implements OnInit { ...@@ -61,14 +61,19 @@ export class SendShippingActionComponent implements OnInit {
let realResSelected: string[] = this.attachList.map((e: any) => { return e.res_id_master; }); let realResSelected: string[] = this.attachList.map((e: any) => { return e.res_id_master; });
this.http.put('../../rest/resourcesList/users/' + this.data.currentBasketInfo.ownerId + '/groups/' + this.data.currentBasketInfo.groupId + '/baskets/' + this.data.currentBasketInfo.basketId + '/actions/' + this.data.action.id, {resources : realResSelected, data: { shippingTemplateId: this.currentShipping.id }, note : this.noteEditor.getNoteContent()}) this.http.put('../../rest/resourcesList/users/' + this.data.currentBasketInfo.ownerId + '/groups/' + this.data.currentBasketInfo.groupId + '/baskets/' + this.data.currentBasketInfo.basketId + '/actions/' + this.data.action.id, { resources: realResSelected, data: { shippingTemplateId: this.currentShipping.id }, note: this.noteEditor.getNoteContent() })
.subscribe((data: any) => { .subscribe((data: any) => {
if (data && data.data != null) {
this.dialogRef.close('success');
}
if (data && data.errors != null) {
this.notify.error(data.errors);
}
this.loading = false; this.loading = false;
this.dialogRef.close('success');
}, (err: any) => { }, (err: any) => {
this.notify.handleErrors(err); this.notify.handleErrors(err);
this.loading = false; this.loading = false;
}); });
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment