Update attachment list

This commit is contained in:
Peter Maquiran
2021-12-11 16:43:22 +01:00
parent 1d73de84e3
commit 621e2180f3
@@ -442,7 +442,7 @@ export class ExpedienteDetailPage implements OnInit {
if (res) {
const data = res.data;
this.documents.push(data.selected);
this.documents.forEach((element: any) => {
await this.documents.forEach( async (element: any) => {
let body = {
"InstanceID": this.task.InstanceID,
@@ -458,15 +458,16 @@ export class ExpedienteDetailPage implements OnInit {
const loader = this.toastService.loading()
this.attachmentsService.AddAttachment(body).subscribe((res) => {
this.toastService._successMessage()
}, () => {
this.toastService._badRequest()
}, () => {
try {
loader.remove()
await this.attachmentsService.AddAttachment(body).toPromise()
this.toastService._successMessage()
} catch(e) {
this.toastService._badRequest()
}
});
});
this.LoadTaskDetail(this.serialNumber);
}
});