catch added to getattachmentsbyid call

This commit is contained in:
Eudes Inácio
2022-12-21 16:25:09 +01:00
parent b2981edf3f
commit 93bbe3f188
14 changed files with 57 additions and 24 deletions
@@ -497,7 +497,9 @@ export class EditEventPage implements OnInit {
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
});
},((erro) => {
console.error('editgetAttchament', erro)
}));
}
deleteAttachment(attachmentID: string, index) {
@@ -29,7 +29,9 @@ export class AttachmentsPage implements OnInit {
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
this.loadedEventAttachments = attachments;
this.pageId = eventid;
});
},((erro) => {
console.error('loadtAttchament', erro)
}));
}
async viewDocument(documenturl:string)
@@ -194,7 +194,9 @@ export class EditEventPage implements OnInit {
this.loadedEventAttachments = res;
});
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
{
@@ -192,10 +192,9 @@ export class EventDetailModalPage implements OnInit {
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
},(error) => {
});
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
{
@@ -190,7 +190,9 @@ export class EventDetailPage implements OnInit {
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res;
});
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
{
@@ -144,8 +144,11 @@ export class ApproveEventModalPage implements OnInit {
}
async getAttachments() {
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
try {
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise;
} catch (error) {
console.error('getAttachments', error)
}
}
@@ -30,7 +30,9 @@ export class AttachmentsPage implements OnInit {
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
this.loadedEventAttachments = attachments;
this.pageId = eventid;
});
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
@@ -189,7 +189,9 @@ export class EditEventPage implements OnInit {
this.loadedEventAttachments = res;
});
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
{
@@ -186,10 +186,9 @@ export class EventDetailModalPage implements OnInit {
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
},(error) => {
});
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
{
@@ -187,7 +187,9 @@ export class EventDetailPage implements OnInit {
this.loadedEventAttachments = res;
});
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
{
@@ -117,7 +117,12 @@ export class ApproveEventPage implements OnInit {
}
async getAttachments() {
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
try {
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
} catch (error) {
console.error('getAttchaments',error)
}
}
@@ -481,9 +481,13 @@ export class EditEventToApprovePage implements OnInit {
async getAttachments() {
let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
let result: any;
try {
result = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
} catch (error) {
console.error('getAttachment',error)
}
result.forEach((e)=>{
e.action = false
})
@@ -456,7 +456,12 @@ export class EditEventPage implements OnInit {
}
async getAttachments(eventId: string){
const rest: any = this.attachmentsService.getAttachmentsById(eventId).toPromise()
let rest: any;
try {
rest = this.attachmentsService.getAttachmentsById(eventId).toPromise()
} catch (error) {
console.error('getAttchment', error)
}
this.loadedEventAttachments = rest;
}
@@ -404,8 +404,12 @@ export class EditEventToApproveComponent implements OnInit {
async getAttachments() {
let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
let result: any;
try {
result = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
} catch (error) {
console.error('getAttachments', error)
}
result.forEach((e)=>{
e.action = false